
I found this that Aaron posted a while back on using Token-mod for a Healing Potion macro:
!token-mod {{ --set bar1_value|[[{@{target|Target|bar1}+2d4+2, @{target|Target|bar1|Max}d1}kl1]] --report all|"{name} takes a healing potion and regains {bar1_value:change}hp." gm:control|"{name} change: {bar1_value:before}hp -> {bar1_value}hp (+{bar1_value:before}hp)" --ids @{target|Target|token_id} }}
One, this sort of works. The health bar change works and doesn't exceed hp_max, but the text is wrong. I tried to update it so that the hp change text was correct and to also remove the requirement to select a target and instead just apply the changes to the currently selected token. But I'm failing miserably. Can someone help point out what I'm doing wrong here?
!token-mod {{ --set bar1_value|[[{{bar1_value}+2d4+2, {bar1|Max}d1}kl1]] --report all|"{name} takes a healing potion and regains [[{{bar1_value}-{bar1_value:before}}]]hp." gm:control|"{name} hp change: {bar1_value:before} -> {bar1_value} (+[[{{bar1_value}-{bar1_value:before}}]])" }}