Overheat battle status KO's when attacking (RMMV)

I hope I'm putting this in the right place.
But is there a way to instantly kill a character after it uses its attack?
So I am inflicting one of my fighters with a status effect called "overheat".
If that character then attacks it will get KO'd immediately.
If it used Guard or an item that's fine. It just can't attack (or use a skill).

Is there a way to do this?
(I'm using RPG Maker MV by the way)
There may be more elegant solutions but this is one I've used for similar purposes in the past.

First in all of your skills, including basic attack, that can trigger overheat death add a.addState(x);
Before the actual damage formula. This will be a dummy state to check who the attacker is. This is important so the next step doesn't murder your entire party just for having the overheat state applied.

Then run a common event on every skill, the same one.
In the common event use conditional branches to check if every single actor you use that makes use of the overheat mechanic has the overheat state. If they do then check to see if they have the dummy attacker state. If they do then apply the K.O. state to them. At the very end of the common event remove the dummy attacker state from the entire party.

Like I said, someone else may be able to come up with a more streamlined or elegant solution using script calls or more complicated damage formulas but this is one method I know of.

Original thread: https://forums.rpgmakerweb.com/threads/overheat-battle-status-kos-when-attacking-rmmv.142482/