MV [SOLVED][YEP Buffs and States Core] A state which gives the target's normal attacks a chance to instantly kill "weak" enemies based on their stats

I'm trying to create a state which allows the target's normal attacks to inflict instant death on enemies if their maximum HP is lower than the user's Atk stat. For example, if a character with 300 Atk has the state applied, and they attack an enemy with 299 or less max HP, let's say there's a 30% chance of inflicting instant death.

Essentially it's intended to be a tool for quickly dealing with weak enemies, while also not allowing players to cheese difficult encounters with instant death effects. I've tried a few variations of scripts using the Buffs and States Core's various effect note tags, but I'm struggling to figure out how (if at all) I can get the state to account for both the user's stats and the enemy's stats.
You could do a <custom confirm effect> tag with

JavaScript:
if (this.isAttack() && target.mhp < user.atk) target.addState(1);
You could do a <custom confirm effect> tag with

JavaScript:
if (this.isAttack() && target.mhp < user.atk) target.addState(1);
This seems to have done the trick, thanks!

Original thread: https://forums.rpgmakerweb.com/threads/solved-yep-buffs-and-states-core-a-state-which-gives-the-targets-normal-attacks-a-chance-to-instantly-kill-weak-enemies-based-on-their-stats.153378/