Lessen damage if opponent has Absorption Barrier

So, I would like for some attacks to have their damage lessened or halved if the target has Absoprtion Barrier points left. Most enemies start battle with some ammount of Barrier you need to fight through first with specialized skills. I'm not quite proficient in script, so I hope someone could help me with the damage reduction.
http://yanfly.moe/2016/02/13/yep-70-absorption-barrier-rpg-maker-mv/
Considering the plugin you're using, you should have the sufficient other plugins to use:

<Pre-Damage Eval>
if (target.barrierPoints() > 0){
value = Math.round(value * 0.5);
}
</Pre-Damage Eval>
Considering the plugin you're using, you should have the sufficient other plugins to use:

<Pre-Damage Eval>
if (target.barrierPoints() > 0){
value = Math.round(value * 0.5);
}
</Pre-Damage Eval>
Indeed I do, and this works great, thanks!

Original thread: https://forums.rpgmakerweb.com/threads/lessen-damage-if-opponent-has-absorption-barrier.106207/