MV YEP_AnimatedSVEnemies, floating enemies.

I had hard time to pick proper section of plugins, so sorry for inconvenience.

What I'm struggling is floating enemies, to be more precise:
I have in database few flying enemies, like bees, bats, harpies etc, and with plugin YEP_AnimatedSVEnemies as you know we can make such enemies to have imitating flying, that's cool, but uh... there is small problem with that. They still float even when they about to die, I checked plugin's help content for more info, but it has no lunatic mode, so my question is, how to land an enemy, when it's going to die (it's alive, but low HP).

I want to advert I have also @caethyril's little plugin floating states and I could just create an empty state that it's automaticly applied when HP is below that critical point, but I don't want to create another empty, pseudo control/support state, because game already have quite large number of states.
My solution to this problem was to create duplicate "grounded" version of the enemy (without the floating tag) and have the regular flying enemy transform into it in a troop event that happens when it reaches the appropriate HP amount. It's inelegant but it did the trick.
True, but I think I'm on a right way to do it more elegant way:
Code:
(function(){
   
'use strict';   

    var alias = Game_Enemy.prototype.isFloating;
   
    Game_Enemy.prototype.isFloating = function() {
        alias.call(this);
        if (this.isDead() && !this.enemy().sideviewFloatDeath || this.isDying()) return false;
        return this.enemy().sideviewFloating;
    }
   
})(Game_Enemy.prototype.isFloating);

I aliased Yanfly's function by adding this.isDying() to return value and basicly this works - when enemy has low hp is sitting ground, but motion don't change to "abnormal" even if it is set in state:

2021-08-18 23_06_59-Database.png



Edit: nevermind. I solved problem - I manipulated enemies hp via console instead using regular game play (in normal play enemy has abnormal motion)

Original thread: https://forums.rpgmakerweb.com/threads/yep_animatedsvenemies-floating-enemies.139707/