Barrier Recovery instead of HP Recovery as lifesteal effect

Greetings! First thread, so apologies if its in the wrong place.
I just started tinkering with RMMV and when I was going through plug-ins I came across the Absorption Barrier by .Yanfly

So I came up with this idea that I'm having a hard time realizing.
The core gameplay loop for this class is: Deal damage with attack/skills to gain barrier points, expend barrier points tanking/on utility abilities (else use HP)

My problem becomes I'm not sure how to convert % Damage dealt to enemy into barrier points after lifesteal heals HP to max, (e.g. mhp; 30% barrier recovery; Deal 30 damage to enemy; gain 10 barrier points to self) Perhaps by having HP overheal flag barrier regen? I tried looking around the internet and the forums but there doesn't seem to be any readily available solution so I would love to brainstorm possible ideas to accomplish this!

Also I'm pretty sure I can facilitate the second half of the gameplay loop with the <User Barrier: -x> to input the custom cost(Does this parameter support % values, or only flat cost? Asking for balance purposes if anyone knows), but I'm not sure how the game should handle a skill that has barrier points or HP as a cost, in a situation where there is no barrier points and the HP cost would kill the actor.

As a side question, is it possible to assign an element to the barrier so that it only blocks that kind of damage? (e.g. a passive counter ability that generates x element barrier when taking x element damage)


My scripting knowledge is pretty basic, but I'm happy to hear any tips!

Edit: Updated as suggested!
Moved to: Javascript/Plugin Support
Please edit your opening post and include a link to the page on Yanfly's site where you got that plugin. That way, if anyone needs to check something in order to help you, they don't have to go hunting.

It would also be helpful if you edited out your final question about designing/balancing a class. It does not belong here at all, and it only causes confusion when a thread contains multiple, unrelated questions. It also means that if anyone in the future has that query, they stand no chance of finding any discussion on it if it is Plugin Support. Please make a new thread in 'Game Mechancis Design'.

Thanks.

Original thread: https://forums.rpgmakerweb.com/threads/barrier-recovery-instead-of-hp-recovery-as-lifesteal-effect.103261/