RMMV Doomguy skill in RPG Maker MV

Hello.I have a question.I m using Yanfly's Absorption Barrier plugin.I want to make a skill for my off-tank character.İts a firebomb and marks the target.Each ally who deals direct damage to the marked target gains barrier points of a certain percentage of the damage dealt(Like if you dealt 100 damage you gain 40 barrier points.Just like the fire weapon in Doom Eternal(The difference is you gain shield point in Doom.)Im a bit new in JavaScript.Still learning the basics and I tried to wrote some codes but it doesnt work.Can you help me with this?
On your notebox, if you have Damage Core, add the following:
Code:
<damage formula>
   value = 5000 + a.mat * 3;
   var barrier = Math.floor(value * 0.4);
   user.gainBarrier(barrier, 0);
</damage formula>

You can change both formulas as they fit your game.
On your notebox, if you have Damage Core, add the following:
Code:
<damage formula>
   value = 5000 + a.mat * 3;
   var barrier = Math.floor(value * 0.4);
   user.gainBarrier(barrier, 0);
</damage formula>

You can change both formulas as they fit your game.
I tried this.Its great with a buff.But this is only useful for the caster.I want the allies who damage the marked enemy to gain a certain percentage of the direct damage they hit. Is this possible?

Let me try to explain it like this.Lets call our status effect "Fire Shield".
For example we have 3 Actors named Eric,Vanessa and Jack.And a boss enemy named Monster.Eric uses Fireball to enemy Monster and affects "Fire Shield" status effect on it and marked it.Then Vanessa uses a sword strike and deal 200 damage to him and she gains 80 barrier points(%40).At the end Jack deals 100 damage to the Monster and gains 40 barrier points.It should be working like this.Hope ı can explain this time.
I think you would need the attack to inflict a state on the target, and maybe have a custom react effect similar to what @killdude wrote. But I'm not good with javascript. You would need Yanfly buff and state core though for the custom react effect.
I think you would need the attack to inflict a state on the target, and maybe have a custom react effect similar to what @killdude wrote. But I'm not good with javascript. You would need Yanfly buff and state core though for the custom react effect.
Yes I know and tried with buffs and states core but my knowledge is not enough 😀
Maybe you could peruse the Yanfly tips and tricks page, find something close to what you want, and modify it?
Maybe you could peruse the Yanfly tips and tricks page, find something close to what you want, and modify it?
I made a code like this and finally it worked 😀 İt is confusing to use Custom Action Effects for me.Im sharing the code maybe it will be handful for someone.İts very simple but hey thats my first working code 😀

<Custom React Effect>
// Check to see if any physical damage is dealt.
if (value > 0 && this.isPhysical()) {
// Calculate the barrier points that the attacker gains.
var armor = Math.floor(value * 0.5);
// Apply the barrier points on the user.
user.gainBarrier(armor, 4);
}
</Custom React Effect>

Original thread: https://forums.rpgmakerweb.com/threads/rmmv-doomguy-skill-in-rpg-maker-mv.120522/