MV How to replicate the Skyrim Standing Stones type of passive states?

I have these passive totems in my game that correctly give me the passive state of the selected totem but when I use a Inn or die they go away, how can I bypass this issue? I don't even think I'm using the Yanfly's Auto Passive States note tags for them but it works as intended OTHER then the inns and dying causes removal of the totem.

here is all I really needed to do to get the passive to apply, but I realized the Inn cancels it

1655849671853.png


Here's the state:
1655849778010.png

as you can see I don't use any of the Yanflys tags yet, I tried to enable it as long as a switch is on but the Inn still removed the passive, Is there a way that I can have a Key Item trigger the passive for ALL party members?
The reason why all states are cleared on death is because of the function clearStates in the class Game_BattlerBase within the file rpg_objects.js in the js folder.

The die and recoverAll functions run clearStates function. You would have to make a plugin to overwrite Game_BattlerBase.prototype.clearStates by adding a conditional statement for the state ids affecting the actors.
Plugin link for ease of reference:
The idea behind passive states is that they never get added or removed: they're always there, but they may be inactive based on a condition. Unlike normal states, they won't get removed by death (state 1) or Recover All.

You could do this for each of your "standing stone" states:
  1. Add a notetag like this to the actor, to give them the passive:

    <Passive State: 123>
    Replace 123 with the passive state's ID.

  2. Add a notetag like this to the state, to decide when the passive is active:

    <Passive Condition: Switch 456 ON>
    Replace 456 with the ID of the switch for this state.
Then when you want to switch passives, just turn the appropriate switches ON/OFF. This assumes you have 1 switch per passive.
The default functionality is that all states are always removed when the player uses an Inn, or dies.

Yanfly has a passive states plugin, which causes a state to become active when a condition is met, and inactive when it is not. You seem vaguely aware of this already, but it doesn't look like you've tried to set it up yet.

Set all 7 of your states as passive on the actors in the plugin parameters by default, or on each of their classes, or whatever.

On each state use the following note tag: <Passive Condition: Switch x ON>, replace x with the number of the switch for that specific state.

When activating the standing stone event, turn on the switch for that state, and turn off the others.
Plugin link for ease of reference:
The idea behind passive states is that they never get added or removed: they're always there, but they may be inactive based on a condition. Unlike normal states, they won't get removed by death (state 1) or Recover All.

You could do this for each state:
  1. Add a notetag like this to the actor, to give them the passive:

    <Passive State: 123>

    Replace 123 with the passive state's ID.

  2. Add a notetag like this to the state, to decide when the passive is active:

    <Passive Condition: Switch 456 ON>

    Replace 456 with the ID of the switch for this state.
Then when you want to switch passives, just turn the appropriate switches ON/OFF. This assumes you have 1 switch per passive.
Yes do this if you use passive states from Yanfly.
You guys are genius! It worked exactly how you guys said it would I added the passives to the actors and switch them conditionally with the switches as the totem activates, the only issue I ran into was it allowed previous ones to stack until you use an Inn but I can show a screenshot of how I fixed that!

As Long as you add a Recover all command to the bottom it takes away the previous ones!
1655852567297.png
I suggest you remove the Change State commands. As mentioned, they are not necessary for passive states because passives are always present, even when inactive. Adding them as normal states as well may have strange side-effects.
I wanted to mention an alternative, as the above solution can get out of hand if you have lots of actors and lots of possible stones. You would need actors * passives switches. With just 3 stones and 4 actors this is already 12 switches.

Yanfly also has a plugin called State Categories:

You could also put these states in the following categories:
Code:
<Category: Bypass Death Removal>
<Category: Bypass Recover All Removal>

Original thread: https://forums.rpgmakerweb.com/threads/how-to-replicate-the-skyrim-standing-stones-type-of-passive-states.148767/