Skills that instantly kills if the enemy has a lower level than the caster

Hey guy, so I'm kinda new to RPGM and I want to make a spell that has the effect in the title. I already created a status which serves as "mark", so the enemy with that status that gets hit is ko, but I cannot find a way to limit it to enemies with a lower lvl than the caster. Any suggestions on how to do it?
the problem is that the engine by default has no level system for enemies. so trying to have an effect based on "level" isn't possible without plugins. Theres plugins like this one thatll let you assign levels to enemies that you can then use inside of your formulas, but without one you'd have to use some other parameter

EDIT: forgot yanfly's enemy level plugin is a paid one. there are free alternatives you can use
Put this in the damage formula, after adding a plugin to give enemies levels:

b.level < a.level ? b.mhp : 0

That should do it.

Note that is the code I use in MZ for the same effect, it should work in MV. If not let us know but someone else will have to fix it as I don't use MV.
the problem is that the engine by default has no level system for enemies. so trying to have an effect based on "level" isn't possible without plugins. Theres plugins like this one thatll let you assign levels to enemies that you can then use inside of your formulas, but without one you'd have to use some other parameter

EDIT: forgot yanfly's enemy level plugin is a paid one. there are free alternatives you can use
thanks a lot

Put this in the damage formula, after adding a plugin to give enemies levels:

b.level < a.level ? b.mhp : 0

That should do it.

Note that is the code I use in MZ for the same effect, it should work in MV. If not let us know but someone else will have to fix it as I don't use MV.
thanks a lot, I'll try
Put this in the damage formula, after adding a plugin to give enemies levels:

b.level < a.level ? b.mhp : 0

That should do it.

Note that is the code I use in MZ for the same effect, it should work in MV. If not let us know but someone else will have to fix it as I don't use MV.
I still havent try it, but I have another question. Having installed the plugin, could I set a battle status to only being inflicted to enemies of a lower level than the character who inflicts it?
for that, id install yanfly's skill core plugin and put this in that skill's notebox:
Code:
<After Eval>
if (target.level < user.level) target.addState(state'sID);
</After Eval>
just replace state'sID with the id of the state you want it to inflict
perfect, thanks

Original thread: https://forums.rpgmakerweb.com/threads/skills-that-instantly-kills-if-the-enemy-has-a-lower-level-than-the-caster.163414/