How to do a on/off buff skill ?

Hello everyone ! I'm working on a mage class, a support kind of class who could do ton of damages or buff it's teamates like hell. I had an idea for a skill who will look like this;


_Name : Magicae Dominum


_Desc : Add the state Magicae Dominum (increase user's magic attack, defense and double all mana costs)


This is how you activate the buff, but now the thing i need is a way to turn off the buff. Let me explain : I know I can create another ability who could just remove the state but this is not what I realy want. What I want is a way to turn the state On or Off with the same skill ! I've done some reaserches, I think the awnser is in the formula, since you can put conditions and add buffs. If someone up there knows how to do this kind of things it would REALLY help me ! 


Plus ! I don't realy know if this is possible with the MV limits but if you guys knows how to make this ability not using the turn of the user (make it like a simple switch move), tell me about it !
'General Discussion' forum is for discussing general principles of game making.  Straightforward "How to...?" questions should be in the Support forum of the engine you are using.  Based on the info under your avatar...


I've moved this thread to RPGMaker MV. Please be sure to post your threads in the correct forum next time. Thank you.
Oh how bad I wish we could answer with a meme lol


I think what you might want to try is YEP Skillcore.


I havent seen EXACTLY what you are trying to accomplish be accomplished but that doesnt mean it's not possible.


Id watch a few different videos of people who have used this plugin and what they have done with it and see if you can dissect a method out of it.
I'm alreay using this plugin only for the hp and % cost, and to be more precise, I just want to do a skill that apply a state which could be removed exactly by the same skill after. So ! I'm going forward to the plugins, I'll see what I can do.
If


affected by state


change state


else


nada


thats the only way I can think of doing it is with a conditional branch in a common event stating, if the dude is poisoned, if you poison him again he is no longer poisoned.
And what about this : ( this would be the formula of the skill )


if (a.isStateAffected( Magicae Dominum )) {a.removeState( Magicae Dominum )} else {a.addState( Magicae Dominum )};


I think it could work , but the thing is that I don't know what's the right way to remove a state in the formula... Maybe you know how to ?
Well seems like the good old comun events will always be better than plugins ! The skill is successfuly working but the only problem is that if only one guy use this skill all the others who got the same class will be affected, and that's way too OP. But it doesn't realy matter, I think i'll force players to pick different classes per characters ! Thanks you mate, i'm puting you in my credits 😉

Original thread: https://forums.rpgmakerweb.com/threads/how-to-do-a-on-off-buff-skill.64360/