RPG Maker MV Switch healing and damage

Hi.Im looking for a state for switching healing and damage.Like when a enemy attacks you youll heal.But if an ally heals you youll be damaged.Let me explain with some links.I want a skill like that:
https://sonny.fandom.com/wiki/Buff_1
And the switch state:
https://sonny.fandom.com/wiki/Subversion_(Sonny_2)
EDIT:
Sorry, misread what you wrote
Try this. You'll need the following plugin:
http://yanfly.moe/2015/12/25/yep-50-buffs-states-core/

Add this to your "zombie" state:
<Custom React Effect>
// Checks to see if effect is altering HP
if (this.isHpEffect()) {
// Flips the value by multiplying by -1, changes damage to heals and visa versa
value = (value * -1);
}
</Custom React Effect>

What this is doing is checking to see if the target's HP is being changed by any effect (damage or healing skill/item), if so, multiply the value of that damage or healing skill by -1.

This will make something that would damage for 800 HP, flip to -800 (when a number is negative, it's considered healing in the MV engine), and visa versa....if something would heal for 800 (in the engine, that would read at -800), then it's flipped to 800, which would then become damage.
Thank you!
Try this. You'll need the following plugin:
http://yanfly.moe/2015/12/25/yep-50-buffs-states-core/

Add this to your "zombie" state:


What this is doing is checking to see if the target's HP is being changed by any effect (damage or healing skill/item), if so, multiply the value of that damage or healing skill by -1.

This will make something that would damage for 800 HP, flip to -800 (when a number is negative, it's considered healing in the MV engine), and visa versa....if something would heal for 800 (in the engine, that would read at -800), then it's flipped to 800, which would then become damage.
O Im sorry i forgot to tell it.Youre script is great but it seems its not working for periodic damage or healing(DOT,HOT) could you edit this including them too?
The closest tag available for the regen on the plugin is this

Code:
<Custom Regenerate Effect>
code
code
</Custom Regenerate Effect>
This effect will run whenever the battler would regenerate HP, MP, or TP. The code will process after all the other regenerate effects have ran.

The only problem is that the code will only run after the regen is done so what you will do is to actually reverse the effect with twice the potency. Im not sure though if using "value" can give you the amount regenerated, else maybe you'd just need to get the HP/MP/TP regen traits value directly. Im also unsure if you can filter if its HP/MP/TP regen.

I also don't know if it will run during slip damages.
Ok thank you anyway.

Original thread: https://forums.rpgmakerweb.com/threads/rpg-maker-mv-switch-healing-and-damage.106575/