Hi, I'm using a system that is not integrated in Roll20 (Corporation RPG) and am trying to write some quick macros to help with rolls. In this system a roll is 2d10 and you must roll equal or under your AT(action total), and the difference with which you succeeded (or failed) is called XS. For example roll Agility + Close Combat with an AT of 14. Player rolls 2d10, results 6 and 2 for a total of 8. The XS would be 6. In some circumstances, this XS is applied to the damage roll. I need a way to store this simple variable when the attack is rolled so that it is added to the damage. For the moment I have a simple macro without any API scripts that asks for the AT when players click the attack button, and displays the XS in chat, and then another macro for damage that requires the player to manually input said XS. I'm trying to use setattr on an empty attribute i called atkxs so that when the attack roll is made, the XS is stored and then can be used automatically on the damage roll. I need the original attack roll to both store the XS and be displayed normally so that we can see the dice rolls and check for critical hits(manually, I'm not looking for crit integration right away). I tried a couple of things but it seems setattr can change the value of my atkxs attribute but not use that new value in the same macro. I nested the roll inside the setattr like that: !setattr --sel --silent --atkxs|[[@{melee at} + ?{Modifier|0} - 2d10cs1cf10]]. This works fine for storing the value, but it doesnt display the roll in chat, which i need in order to check for crits. When I tried to put that !setattr line inside the template macro I have for the attack, it displays the whole line as text and shows the roll but doesn't store the value on my atkxs attribute. &{template:default} {{name=@{name} @{melee weapon} Attack}} {{Excess: !setattr --sel --silent --atkxs|[[@{melee at} + ?{Modifier|0} - 2d10cs1cf10]] = [Roll Damage](~meldmg)}} How do I get this to both display the roll results as usual but also store the same result in my atkxs attribute? Thank you very much, I'm trying to awaken my long lost basic programming skills (did a little bit in high school, enjoyed it very much).