MZ How to replace a state with another state if target has a certain state already applied?

So I want to make state become another state if the target already has a certain state applied. For example:

The enemy is being targeted by a skill that will inflict the Poison state. But because the enemy has the Poison Tolerance state then the skill will inflict the Weaker Poison state rather the regular Poison state.

I'm using the Visustella plugins so I would prefer to use notetags through plugins rather then having to go through the headache of using common events and placeholder states.
If you can't find anything in VisuStella, there's Hime's Placeholder Statea plugin. It's for MV, but I think there's a very good chance it works in MZ too.
If you can't find anything in VisuStella, there's Hime's Placeholder Statea plugin. It's for MV, but I think there's a very good chance it works in MZ too.

Yeah that's what i was doing but unfortunately there's an incompatibility issue with Visustella's ATB Plugin so i got to go down another route.
You could use a condition beach in the ability/event that causes the 2nd condition... But that's not what you're looking for is it?
You could use a condition beach in the ability/event that causes the 2nd condition... But that's not what you're looking for is it?

Yeah I the longer way to do this would be to make a placeholder state and then make a common event for each state to check if the target gets inflicted with the regular state or the weaker version of the state, but I want to try and be as efficient as I can if I can help it and using the notetags would be easier, y'know?
you should be able to use the visustella <JS On Add> or whatever notetag the states and skills core plugin has on poison to check if the target has the resistance and then remove itself and add another state.
you should be able to use the visustella <JS On Add> or whatever notetag the states and skills core plugin has on poison to check if the target has the resistance and then remove itself and add another state.

I never got around to learning JS so I have no idea what I need to write down to make it do that lol
try
Code:
<JS On Add State>
if (target.isStateAffected(x)){
  target.removeState(state.id);
  target.addState(y);
}
</JS On Add State>
where x is the tolerance state's id and y is the new poison's state id

but now that ive thought it over... did you want it to be a separate poison explictly, or just less damage?
cause you could also use the slip damage notetag to determine the damage the state does instead of the hp regen trait and then use the tolerance state to just reduce it there instead of using a weaker poison state
try
Code:
<JS On Add State>
if (target.isStateAffected(x)){
  target.removeState(state.id);
  target.addState(y);
}
</JS On Add State>
where x is the tolerance state's id and y is the new poison's state id

but now that ive thought it over... did you want it to be a separate poison explictly, or just less damage?
cause you could also use the slip damage notetag to determine the damage the state does instead of the hp regen trait and then use the tolerance state to just reduce it there instead of using a weaker poison state

Thank you! This is exactly what I wanted.

I was just using the poison state as an example. I'm mainly going to use it for bosses/mini-bosses so that players can still build around inflicting status effects on bosses, but they also won't be able to trivialize the fights.

Original thread: https://forums.rpgmakerweb.com/threads/how-to-replace-a-state-with-another-state-if-target-has-a-certain-state-already-applied.183905/