How to make that your actors won't choose automatically next target in battle

Hi people, I have been trying to edit rpg maker mv javascript to make that when an enemy is dead, your party won't automatically target other allied members. Like in original Final Fantasy.

I have found the right place I think in rpg_managers.js at line 2465
BattleManager.getNextSubject = function() {


But I have not yet been able to figure how to make the game pop up a text box instead on the right position. I know how to put a text box that would say: "The target is already dead". At what position I should put it, and what should I delete so actors would not choose the next target? Thank you for the help in advance.

Some might wonder why would want to do this, and that is a valid point. I would like to make so that you cannot spam space in battle when you get high level. You essentially lose actions if you are able to defeat the original target.

Again, thank you for your possible help!
I know a game that it skip their turn when the enemy is dead or guard otherwise,
that is a very nice idea, but I wont go into the core plugin itself, it's safer to make an alias
to that function in a new plugin, if something goes wrong, you can edit from that 🙂

But im not sure how to do that either.
Yeah, some games tried the idea, but most go with auto targeting with good reasoning.

I have tried for a couple of hours with my limited javascript understanding to try to find the right spot. I will appreciate it a ton if anyone here know the answer 😠

Original thread: https://forums.rpgmakerweb.com/threads/how-to-make-that-your-actors-wont-choose-automatically-next-target-in-battle.117495/