RPGMAKER MV: Healing Formula

I was making an enemy that I envision to have a healing skill that scales in strength depending on how much health it has left.
Basically, the enemy is meant to regain 50% of its missing HP. So the higher its health, the lower the amount of hp it will regain.
I'm still familiarizing myself with coding, so this may seem obvious, but any help with the formula would be greatly appreciated.
mhp is maximuim hp, while hp is the current value.
you want half of the difference, so

(b.mhp - b.hp)/2

heals half of the targets damage (if no other influence exists)

Other influences may include variance, elemental rates, damage rates and so on, but those are all set by your enemy traits.
mhp is maximuim hp, while hp is the current value.
you want half of the difference, so

(b.mhp - b.hp)/2

heals half of the targets damage (if no other influence exists)

Other influences may include variance, elemental rates, damage rates and so on, but those are all set by your enemy traits.
Thank you so very much! I was so stumped. It works amazingly~

Original thread: https://forums.rpgmakerweb.com/threads/rpgmaker-mv-healing-formula.156365/