The best I could think with the help of the AI is this but doesn't work:
Code:
const _Sprite_Battler_update = Sprite_Battler.prototype.update;
Sprite_Battler.prototype.update = function() {
_Sprite_Battler_update.call(this);
if (this._battler && this._battler._iddleType) {
this.updateIddle();
}
};
Sprite_Battler.prototype.updateIddle = function() {
const speed = this._battler._iddleSpeed;
if (this._battler._iddleType === 'hover') {
this.y = this._battler._originalY + Math.sin(Graphics.frameCount * speed) * 10;
} else if (this._battler._iddleType === 'walk') {
this.x = this._battler._originalX + Math.sin(Graphics.frameCount * speed) * 10;
}