MV Remove State when out of Barrier Points

Heyho!
I am trying to use Yanfly Buffs and States Core and Absorption Barrier to create a state which disappears as soon as the wielder is out of barrier points. I know Absorpion Barrier has a built in function to inflict and remove a barrier state, but I'd like to create an addional state working the same way (the built in state also does not work for some reason, but this is another topic).

I tried this:

Code:
<Custom Respond Effect>
if (user.barrierPoints() < 1) {
  user.removeState(40);
}
</Custom Respond Effect>

But the state just stays on the battler, regardless what happens.
Thanks in advance ~
In case it helps:

Alternatively, I released it as a full plugin, CaeX_YEPBarrierFX, found here in the "Extension" category:
You could use this for that plugin's "On Removal" parameter:

battler.removeState(40);
I tried this:

Code:
<Custom Respond Effect>
if (user.barrierPoints() < 1) {
  user.removeState(40);
}
</Custom Respond Effect>
respond uses the user of the skill as its user and target as its target. youre checking if the attacker of the person with the state has barrier points, and then removing state 40 from the attacker if the attacker doesnt have any when you meant the target
respond uses the user of the skill as its user and target as its target.
As do all of the skill-timing-related notetags.

It took me a little while to wrap my head around it, because I was intent on thinking the battler that has the state is always user, but user and target is going off of the actual battle resolution.
I see~
Thanks to all of you 🙂 As always this forum is incredibly helpful!

Original thread: https://forums.rpgmakerweb.com/threads/remove-state-when-out-of-barrier-points.163572/