YEP Auto Passive States: Custom Apply Effect stops working

I'm using YEP plugin to make it so that when the player get's a certain state, a switch is turned on by adding the following to the notetag of the state:

<Custom Apply Effect>
$gameSwitches.setValue(1001, true)
</Custom Apply Effect>

This works as intended, but when I try to do the same but the state is a passive state given by equiping a armor, it stops working. For example, for the piece armor notetag, I add this in the notetag:

<Passive State: 34>

The state is still triggered, because I see the icon for it, but the switch is no longer triggered. Anyone knows if there is a way to circumvent this? Did i make a misstake or is there a fix?
passive states do not trigger apply and removal effects. Turan has a fix you could try to patch in.
Thanks for sending the solution! It seems like Turan is saving me on the daily these days 😀

Original thread: https://forums.rpgmakerweb.com/threads/yep-auto-passive-states-custom-apply-effect-stops-working.174246/