Question About States

Hey all just a question regarding states.

In the game I'm making, the party can execute skills in a certain order to provide party-wide buffs.
I've been using states to create these, however in my design, I don't want more than one of these to be able to be active at any given time. Other buffs/debuffs are fine but these bigger party-wide boosts...I'd like them to overwrite one another.
So for example if I cast the attack buff, but then see the boss is charging for a big attack, I would cast the defense buff which ideally would cancel the attack buff. I just haven't been able to figure out a way to do this.

If anyone could point me in the right direction on how to solve this dilemma I'd be thrilled!
Use Yanfly's Buffs+States core plugin, and a custom apply effect :yhappy:
Put the custom apply effect in the notebox of all your party-wide state buffs that you want to be exclusive, and have it remove the others.

JavaScript:
<Custom Apply Effect>
    user.removeState(x);
</Custom Apply Effect>
Where 'x' is the ID of the state you want to remove. Now, whenever that state is applied, it will remove state X.
Let me know if that helps!
Alternatively you could just make all skills that apply a buff also remove all the other buffs.
I...I'm so used to creating complex state effects, I forgot that was an option...
Okay, trust me to overcomplicate a solution to a simple problem! 😅
Hey all,

I went ahead and used Cythera's solution and it worked great!


I really appreciate all the help, definitely going to run into more problems with this project...good to know there are lots of eager folks willing to help ^^

Original thread: https://forums.rpgmakerweb.com/threads/question-about-states.137183/