How to make a passive state reduce an active state's duration?

Hello, is there a way to reduce a state's turn if the target has a passive state active? For example, if the poison has a duration of 3 turns, can it be reduced to 2 turns if the target has a passive active?

I'm using VisuStella's plugins if that helps.
I'm using VisuStella's plugins if that helps.
Which ones?
Hello, is there a way to reduce a state's turn if the target has a passive state active? For example, if the poison has a duration of 3 turns, can it be reduced to 2 turns if the target has a passive active?
Sure. When the poison state is given (JS On Add State) you look to see if the target has your passive state (target.states().includes($dataStates[X])) then modify the poison state's duration.

So:
Code:
<JS On Add State>
if (target.states().includes($dataStates[X]))
    target._stateTurns[Y]--;
</JS On Add State>

where X is the ID of the passive state and Y is the ID of your poison, no leading zeros. The only trick is where in the addState code VisuStella put that notetag, and we can't tell ahead of time because the plugin is obfuscated.

So if that doesn't work, the alternative would be to create two versions of the poison state and use Skill Core notetags to change which one is given to the battler depending on their passive state.
Sweet, your suggestion works just as intended. Thanks for the response!

Original thread: https://forums.rpgmakerweb.com/threads/how-to-make-a-passive-state-reduce-an-active-states-duration.155544/