Disabling Floating (Yanfly's Animated Battlers)

Yanfly's plugin: http://yanfly.moe/2015/12/13/yep-44-animated-sideview-enemies/

enable enemies to have a floating property where they levitate up and down in the air. This is defined via <Floating> within the enemy's note tag. I'm trying to figure out a way to temporarily/permanently disable that property during battle. Ideally, I'd like to inflict a state who has a "No Floating" property that takes priority over the <Floating> property.

I went looking into the coding and came across lines 1302-1305:
Code:
Game_Enemy.prototype.isFloating = function() {
    if (this.isDead()) return false;
    return this.enemy().sideviewFloating;
};

and changed it to:
Code:
Game_Enemy.prototype.isFloating = function() {
    if (this.isDead() || this.isStateAffected(158)) return false;
    return this.enemy().sideviewFloating;
};

where state 158 is the state I wish to have the Floating-cancelling property. I tested it and it works the way I want it to, so sharing this for anyone else that may be interested. Also, if this is actually not recommended to do, or there's another better method to achieve this, feel free to enlighten me.
You don't need to change the code and add a state.
Just change the variable sideviewFloating on an enemy to false/true.

So for example
$gameTroop.members()[0].enemy().sideviewFloating = false
$gameTroop.members()[0].enemy().sideviewFloating = true

or just
$dataEnemies[ID].sideviewFloating = true
$dataEnemies[ID].sideviewFloating = false
@waynee95 ooh, thanks a lot! Is it completely recommended to use that method instead? Cause I just needed to change one line in the plugin and it's automated now as opposed to writing a few more lines in the state to manage that variable as true or false for the relevant actor/enemy.
Edit: Well, I'd probably like to be able to apply it to actors too thinking about it more now.
Nah, both are fine.

Original thread: https://forums.rpgmakerweb.com/threads/disabling-floating-yanflys-animated-battlers.79009/