MV Creating a "Reversal" status for a game.

I realized a bit too late that I put the original thread in the RPG Maker MV Support section rather than Javascript/Plugin Support because I'm big dumb and can't read.

From the original post:
Howdy howdy! So development on the game I've been working on has proceeded decently since the last posts and threads I posted, and I've learned a bit about things thanks to both this site and Yanfly's tips and tricks for their plugins. Recently however, a thought came to mind about creating a "Reverse" status, akin to the nasty thing Dr. Lugae hits you with in the Final Fantasy IV 3D versions. Basically, all damaging actions become healing and all healing actions become damaging, requiring good timing to prevent casualties.

Now I've used some of Yanfly's tips and tricks like creating Undead foes that are damaged by healing spells but I'm having a little bit of trouble putting the pieces of it together. There's two key components to the Reverse state:
- Making the values of healing/damaging skills (including attacks) the opposite of how they work normally
- Making it so that the "Reversal" skill adds the state on party members that don't have it and removes it on party members that do.

Any help would be appreciated, because I would love to put this nasty awful status in my game to spice things up a bit.
- Making it so that the "Reversal" skill adds the state on party members that don't have it and removes it on party members that do.
skill - Skill Core plugin
Code:
<After Eval>
if (!target.isStateAffected(x)) target.addState(x);
  else target.removeState(x);
</After Eval>

- Making the values of healing/damaging skills (including attacks) the opposite of how they work normally
state - Buffs and States plugin
Code:
<Custom React Effect>
 value = -value;
</Custom React Effect>

although, this only affects skills that deal damage or heals directly by itself. it wont affect things like state based healing/damage and skills that run gainHp() to heal/harm. youll either have to manually make them invert while the state is active, or make a more sweeping change by forgoing the notetag and modifying Game_Battler.gainHp() to invert the values when the state is active
For what I need it to do, it works like a charm, thank you! As for reversing the effects of Regen/DoT effects, how would I go about doing that? I tried this at first, reversing the regen formula I have set up:
Code:
<Custom Regenerate Effect>
if (!target.isStateAffected(64)) {
 user.gainHp((6 + a.luk) * 6 / 2) * -1)
}
</Custom Regenerate Effect>

But that doesn't seem to work, it makes both regen and damage occur at the same time. This is probably above my punching weight but it'll be a good learning experience I'm sure.
Code:
<Custom Regenerate Effect>
if (!target.isStateAffected(64)) {
 user.gainHp((6 + a.luk) * 6 / 2) * -1)
}
</Custom Regenerate Effect>

But that doesn't seem to work, it makes both regen and damage occur at the same time. This is probably above my punching weight but it'll be a good learning experience I'm sure.
you have mismatched parentheses. not sure as to how you'd get 2 popups from this without a second state, but try shortening it to this
Code:
<Custom Regenerate Effect>
user.gainHp((6 + a.luk) * 3 * (!user.isStateAffected(64) ? 1: -1));
</Custom Regenerate Effect>
Thank you! I realized why it was returning a second popup, it was because I forgot to remove the previous <Regen Formula: x> it had, so that's another case of me failing a spot check. With that out of the way and the new formula, everything works like a charm, thank you so much!

Original thread: https://forums.rpgmakerweb.com/threads/creating-a-reversal-status-for-a-game.167428/