YEP_X_BattleSysATB bug ?

Dear all,

I'm using yanfly battle system ATB and I've noticed that when cancelling the Actor Command Window and go back to the Party Command Window, if the current actor motion is IDLE, then he adopts a sprite motion that do not correspond to IDLE. This sprite motion is not refresh until the actor enter in charge.
Can you reproduce this bug with your project or in a new project ?

I wrote a little script to place under YEP_X_BattleSysATB that update the motion refresh to, I hope, fit with ATB battle system.
However, I'm not a good scripter and I would really appreciate any feedback. I don't know if the modification I've made is not source of other bugs. So far I tried, nothing seems abnormal... Let me know please.

Best,

Lay.

Code:
//=============================================================================
// PATCH - Yanfly Engin Plugins - Battle System ATB
// YEP_X_BattleSysATB_LAYpatch.js
//=============================================================================


var Imported = Imported || {};
Imported.YEP_X_BattleSysATB_LAYpatch = true;

var Lay = Lay || {};
Lay.YEP_ATB_patch = Lay.YEP_ATB_patch || {};
Lay.YEP_ATB_patch.version = 1.0

//=============================================================================
 /*:
 * @help
 *
 * ============================================================================
 * PATHNOTE
 * ============================================================================
 *
 * Correction of bad motion when the party command window open.
 *
 * The request for motion, coming from YEP_BattleEngineCore, test if the battle manager
 * phase is set to input. If yes, sprites are refresh according to motion.
 * In YEP_X_BattleSysATB, when going back from the ActorCommand Window to the
 * PartyCommand Window, the Battle Manager phase is set to 'ATB'.
 * Thus, sprites are never refreshed
 * However, since requestMotionRefresh is called, all motion are cleared. This causes
 * actors bad sprite display.
 *
 * Patched function(s) :
 *    - Game_Battler.requestMotionRefresh (YEP_BattleEngineCore)
 *
 * Function using the patched function in YEP_X_BattleSysATB :
 *    - BattleManager.updateEvenMain
 *    - BattleManager.selecNextCommand
 *    - BattleManager.selectPreviousCommand
 *    - Scene_Battle.startActorCommandSelection
 *
 */
//=============================================================================

requestMotionRefreshATB = Game_Battler.prototype.requestMotionRefresh
Game_Battler.prototype.requestMotionRefresh = function() {
    requestMotionRefreshATB.call(this)
    if (this.battler() && BattleManager.isATB()){
        this.battler().refreshMotion();
    }
}

Original thread: https://forums.rpgmakerweb.com/threads/yep_x_battlesysatb-bug.120823/