So I'm working on a system for battlefield encounters for a DnD-esque game to occur in the background and have been trying to set up a macro that I can fire off as an attack action. The calculation should (hypothetically) be: Roll [unitSize]d20 + toHit get the number that pass the enemy AC ([[@{selected|bar1}d20+@{ToHit}}>@{target|Target|AC}]]) Roll [hitCount]d[unit's damage die] + [unit's damage mod] and get the number of insta-kills ([[{@{Hits}d@{Damage_die}+@{Damage_mod}}>@{target|Target|bar3}]]) Then go to the targeted token and set its Count to [count] - [kills] Then modify the unit's hp by: -1*roundDown((1d[unit damage die] + [unit damage mod])*([hits]-[kills]/[newcount])) I went out of my way to get the API so I could try to save values by storing them to the character that is attacking, so I've got the following: // using the setattr and token-mod APIs !setattr --name Kislev Musketeer Cohort --hits|[[@{selected|bar1}d20+@{ToHit}}>[[@{target|Target|AC}]]]] !setattr --name Kislev Musketeer Cohort --kills|[[{@{Hits}d@{Damage_die}+@{Damage_mod}}>[[@{target|Target|bar3}]]]] &{template:default} {{name=*Kislev Musketeers*}} {{Hits=@{Hits}}}{{Kills= @{Kills}}} !token-mod --set bar1_value|[[@{target|Target|bar1}]]-@{Kills} !token-mod --set bar3_value|[[@{target|Target|bar3}]] -[[floor[[[[1d@{Damage_die}+@{Damage_mod}]]*(@{Hits}-@{Kills})/[[@{target|Target|bar1}]]-@{Kills}]]]] Now I can guess that someone here has already noticed whatever the problem is, but I cannot, short of: it's broken. Every time I fire the macro and select a target it hangs up and refuses to select any token I kindly ask it to select. I have spent many dollars, hours, and am contemplating just signing a pact with the nearest devil just to figure out what's wrong. Anyone want to take a stab? PS. If someone knows of something that can do what I am obviously failing at doing, please link it. Thanks!