Showing the Amount of Absorbtion Points in State Icon (Yanfly - RMMV)

Hello Guys,

im trying to get the amount of absorbtion points from the yanfly absorbtion plugin shown in the states icon.

this is the lunatic code i use, which wont work at all:

JavaScript:
<Custom Apply Effect>
user._currentBarrierPoints = user.barrierPoints();
user.setStateCounter(StateID, user._currentBarrierPoints);
</Custom Apply Effect>

<Custom Remove Effect>
user._currentBarrierPoints = undefined;
user.setStateCounter(StateID, 0);
</Custom Remove Effect>

<Custom Deselect Effect>
var points = target.barrierPoints();
if (points !== target._currentBarrierPoints) {
target.setStateCounter(StateID, points);
}
</Custom Deselect Effect>

<Custom Regenerate Effect>
var points = user.barrierPoints();
if (points !== user._currentBarrierPoints) {
user.setStateCounter(StateID, points);
}
</Custom Regenerate Effect>

I hope someone could help me out!

best regards 🙂
push
I haven't tested, but have you tried replacing StateID with stateId? Code is case-sensitive! 😅
Oh my gosh. That fixed it. Thank you very much. 🙂
Oh my gosh. That fixed it. Thank you very much. 🙂

Hey im curious how you fixed it. I have skills and states that add barriers I tried:

Barrier state:
Code:
<Custom Apply Effect>
user._currentBarrierPoints = user.barrierPoints();
user.setStateCounter(stateID, user._currentBarrierPoints);
</Custom Apply Effect>

<Custom Remove Effect>
user._currentBarrierPoints = undefined;
user.setStateCounter(stateID, 0);
</Custom Remove Effect>

<Custom Deselect Effect>
var points = target.barrierPoints();
if (points !== target._currentBarrierPoints) {
target.setStateCounter(stateID, points);
}
</Custom Deselect Effect>

<Custom Regenerate Effect>
var points = user.barrierPoints();
if (points !== user._currentBarrierPoints) {
user.setStateCounter(stateID, points);
}
</Custom Regenerate Effect>

Also in the plugin settings I set the "barrier state". Also for some reason every time I get hit it plays the barrier break animation even though I still have a barrier.

Original thread: https://forums.rpgmakerweb.com/threads/showing-the-amount-of-absorbtion-points-in-state-icon-yanfly-rmmv.125446/