GiGs said: That looks like an incredibly powerful weapon. I'd never gie that to a PC. That aside, do these modifiers apply just when attacking with this weapon? If so, it is definitely doable, but if it applies to different actions, you'll need to modify all those actions as well. If just this weapon, you'll need to modify the code for attacks, for damage rolls, and for AC calculation. With that preamble out of the way, I see a few mistakes in your code. First, you want to calculate a fraction of the remaining hit points. So you need to do (HP|max - HP)/HP|max, then multiple by 10 to get increments of 10%, then floor on that. You have done that, kind of, but I don't know where the /2 comes from. You also can't use min(5, something). You need to use {5, something}kl1 (keep lowest), It's a different syntax. Also when using |max, you need to supply a character name. I've used selected , but you can replace that with the character's actual name (that way you don't need to have a token selected to use it). With all that taken into account, you can calculate the increements like so: [[ {5,floor(((@{selected|hp|max} - @{selected|HP})/@{selected|hp|max}) *10)}kl1]] To get the number of d8, dont do * 1d8 - that will roll the total by a single d8. To get the actual number of d8, stick d8 after the above, like so: [[ {5,floor(((@{selected|hp|max} - @{selected|HP})/@{selected|hp|max}) *10)}kl1]]d8 Note: you can use the first expression above to calulcate the attack modifier,and multiply it by -2 for the AC modifier. I understand your concern about the weapon being powerful at the start. However, it's designed to incorporate an element of risk and reward. When a player wields this weapon, there is a gamble involved. While it provides bonus damage and a +5 to hit, it also imposes a -10 penalty to the player's AC. This means that the player is more susceptible to attacks and there's a real possibility of reaching half HP with a significant negative impact on their overall defense. Despite the potential drawbacks, the player enjoys this gamble and finds it fun. It adds an exciting dynamic to the gameplay, creating a thrilling experience where they have to carefully consider their actions and weigh the risks. Ultimately, it enhances the player's engagement and enjoyment with the game. Additionally, I wanted to express my gratitude for your assistance. Your code was almost perfect for my needs, and with a slight adjustment, it worked perfectly in my character sheet. Your advice and guidance have been immensely helpful, and I cannot thank you enough for your support. Here's the modified code that I used, incorporating your suggestions: [[[[ {5,floor(((@{HP|max} - @{HP})/@{HP|max}) *10)}kl1]]d8]] Once again, thank you for your invaluable help. GiGs said: Of course, ScriptCards needs the campaign creator to have a Pro subscription, and install the script. yeah, I unfortunately can't afford a pro sub at the moment, but the macro works like a charm.