Help, I want to make a status effect that changes the second time you use it :(

Hi, so basically I'm trying to do a skill that adds a status effect to a party member but the second time you use that same skill on the same party member, it adds a different one and removes the previous status effect, but I'm having trouble finding out how to do that 😐 I would really appreciate it if someone could help me.
I'm pretty sure you can achieve this using common events and variables.

To accomplish this, you need to create a variable (let's call it "skill variable") specifically for this purpose. This variable will command two states: the first state and the second state, which is the main state you want, that occurs after the second time you use the skill.

On the skill effects tab, set it to call a common event. Inside that event, include a conditional branch to check if the skill variable has a value of 2. If it does have this value, set it to remove the first state you mentioned and assign the second state. If the value of the skill variable is 1 or less, in the "else" part of the conditional branch, set it to add 1 to the variable and assign the first state.
I'm pretty sure you can achieve this using common events and variables.
You could do this with an event, no need for variables. Using a variable the way you describe would result in the second state being used whether or not the skill was used on the same target.

You do, however, need a way to track the target of the skill. This is commonly done with a dummy state.

In the Effects of the skill, apply the dummy state to the target, then call a common event.

In the event, check each member of the troop.
- If they have the dummy state:
-- Check if they have State 1 applied. If not, apply State 1 and be done.
--- If they do have State 1 applied, remove State 1 and apply State 2
- Remove the dummy state

----------------------------------------------------------------------------------

The easier way to do this is with Yanfly's Skill Core.
Code:
<Post-Damage Eval>
if (target.isStateAffected(X))
{
    target.removeState(X);
    target.addState(Y);
}
else
    target.addState(X);
</Post-Damage Eval>
where X is the ID for State 1 and Y is the ID for State 2 - no leading zeros.
You could do this with an event, no need for variables. Using a variable the way you describe would result in the second state being used whether or not the skill was used on the same target.

You do, however, need a way to track the target of the skill. This is commonly done with a dummy state.

In the Effects of the skill, apply the dummy state to the target, then call a common event.

In the event, check each member of the troop.
- If they have the dummy state:
-- Check if they have State 1 applied. If not, apply State 1 and be done.
--- If they do have State 1 applied, remove State 1 and apply State 2
- Remove the dummy state

----------------------------------------------------------------------------------

The easier way to do this is with Yanfly's Skill Core.
Code:
<Post-Damage Eval>
if (target.isStateAffected(X))
{
    target.removeState(X);
    target.addState(Y);
}
else
    target.addState(X);
</Post-Damage Eval>
where X is the ID for State 1 and Y is the ID for State 2 - no leading zeros.
Omg it worked! Thank you so much for your help!
Could also use action sequences for it... 🤣
or

Original thread: https://forums.rpgmakerweb.com/threads/help-i-want-to-make-a-status-effect-that-changes-the-second-time-you-use-it.158538/