Yanfly's Absorption Barrer - Show current barrier

Anybody know if there is a way to show the current amount of barrier points the user has when using Yanfly's barrier plugin? http://yanfly.moe/2016/02/13/yep-70-absorption-barrier-rpg-maker-mv/

I know the plugin gives you a little "color change" in your HP bar when you have a barrier, but I like to provide my players with NUMBERS, so I was wondering if anybody knew how to actually show the exact amount of barrier points on the state itself?

This Tips&Tricks shows how you can show an "amount" on the state, so ideally, this is what I'd like to emulate for the barriers:
http://yanfly.moe/2016/10/03/tips-tricks-heal-jammer-rpg-maker-mv/
If I remember correctly, the Absorption Barrier plugin has a parameter that applies a designated state if a barrier is active. Using such a state, something like this could work in the state notetag:

<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>

The 'user' may need to be 'target' instead. But this next part is where it gets tricky because the counter needs to update EVERY time the barrier changes, and it needs to be done manually each time. Try this out:

<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>

If the state priority is very low, like at 0, it should change after everything else applies. Remember, this state only monitors the barrier points; it doesn't actually change any of the numbers.

Edit: Made a mistake in the regenerate tag. Fixed it.
Duuuuuuuuuuuude, you're amazing, thank you so much! Just tested it (with a few tweaks) and it works perfectly! 😀
Duuuuuuuuuuuude, you're amazing, thank you so much! Just tested it (with a few tweaks) and it works perfectly! 😀
I need this, if you have already succeeded, please give me a copy. Thank you.
Necro-post notice: Erodaisiki
You can either pm the Member or start a new thread with your query.

Original thread: https://forums.rpgmakerweb.com/threads/yanflys-absorption-barrer-show-current-barrier.93572/