MV Yanfly Battle Engine: Disable target immortality, Multi hit skills targeting dead battlers

If a multi hit skill (whether its "X random enemies" or "Repeat: x") is used against a target, and the target dies midway through the skill, they can still be targeted.

My first thought was to disable the immortality feature, but there was no plugin config for it, contrary to what the plugin description said. So, I commented out line 1369 so that immortality isn't added to targets at the start of every action.

Original Code:
Code:
Yanfly.BEC.DefaultActionSetup = [
    ['CLEAR BATTLE LOG'],
    ['DISPLAY ACTION'],
    ['IMMORTAL', ['TARGETS', 'TRUE']],
    ['PERFORM START'],
    ['WAIT FOR MOVEMENT'],
    ['CAST ANIMATION'],
    ['WAIT FOR ANIMATION']
];

Line 1369 is " ['IMMORTAL', ['TARGETS', 'TRUE']], "

So, now targets aren't immortal during actions, now what?
When I use the multi hit skill, the targets will collapse when they reach 0 HP, but they can still be targeted despite being dead, but only for the duration of the action.
Any actions afterwards aren't able to target the dead targets.

How can I make it so targets can't be targeted if they die?

TL;DR In battle, targets that die can still be hit by the same skill if the skill has multiple hits.

Edit: A sample project to test what I'm talking about. Open up a test battle with the bats, and use your regular attack as Harold.
Edit 2: Removed Google Drive link due to fear of exposing gmail. To recreate the bug, use a "4 random enemies" target skill that one shots enemies. Have two enemies in a troop, and use the skill on them. Then, I suggest repeating the same steps as above after commenting out Line 1369 on the Battle Core.
bump
bump
bump
bump

No idea if it's frowned upon to bump my own thread from years ago, so apologies in advance. I still have this issue.
The problem is that the targets aren't chosen during the skill's execution, they're determined when you confirm the skill and target.

It's possible to change that, of course, but the easier course (and safer since you use plugins) would be to use action sequences.

With a single-target, multi-hit skill, just include a death break after each hit.

Random target skills are a bit trickier - you'd make the skill scope all enemies and move the programming for choosing and hitting the random targets into the action sequence itself.
Sorry to bother you, but I can't figure out how to program random targeting within the action sequence itself.

Original thread: https://forums.rpgmakerweb.com/threads/yanfly-battle-engine-disable-target-immortality-multi-hit-skills-targeting-dead-battlers.138486/