Hello everyone o/ I have a homebrew ability for one of my players that is essentially like Blood Mage, in that it uses a temporary health pool that can be used to cast certain spells via sacrificing a percentage of their current/max health or by a flat value (whichever is higher). For example: <spell> Sacrifices 10% of current hit points or 10 hit points. Now I've looked into the different kinds of dice rolling you can do, and I had an equation that would take the health value and calculate the percentage (say 25%, rounded up) and compare it to the flat number, then return which was the higher of the two. However, this would mean that the equation would have to be updated whenever the health would change, so that would be too much work for the player or myself as the DM to do on the side. Alternatively, I looked into automatic resource management/ammo counters that would do the subtraction but they only go down by flat increments of 1. I would try to write my own script for it, but I, unfortunately, don't know how to code :( Might anyone be able to help me?