You could add in something like atk * (1 - (a.hp/a.mhp)) to get that effect. It deals damage based on a percentage of their current health over their max health. Alternatively, if you wanted to do something like deal 2 damage per each HP lost, you would do 2 * (a.mhp - a.hp). I've been trying to figure out the command for doing this, as well. My only difference is that I would want it to heal the entire party instead of every OTHER member, but I figure the way to do it would be similar. Any ideas?