MV Change window position

Hello, I am trying to change battle status window position, specifically value of x. When I change y, width or height it works as intended, however when I change value of x, window always returns to the same position as shown in gif.

Here is the code I changed, its located in rpg_scenes.js (In gif value of this._statusWindow.x is 3300 so its more clear that window moves)
JavaScript:
Scene_Battle.prototype.createStatusWindow = function() {
    this._statusWindow = new Window_BattleStatus();
    this._statusWindow.x = 900;
    this._statusWindow.y = 850;
    this._statusWindow.width = 800;
    this._statusWindow.height = 190;
    this.addWindow(this._statusWindow);
};
The battle scene updates the x position of the status window each frame based on the current battle phase. This updating is done in the updateWindowPositions method of Scene_Battle.

Also, note that you should recreate a window's contents after changing its width/height. If possible, it's better to pass a different size to its initialize method rather than resize it afterwards; for example, in this case you can override the window's windowWidth method to change the width. Otherwise you can invoke the window's createContents method after changing its size.

I would recommend making changes to the core scripts using plugins, not direct edits. RMMV is no longer receiving core script updates, but plugins can be turned on/off at will and are much easier to track (e.g. for support, compatibility, and/or credit purposes). 😮‍💨

Try saving this code as a .js file (or download the attached file) and import it as a plugin:
Spoiler: Suggested plugin code
JavaScript:
/*:
 * @plugindesc Status window edits: change position and stay still.
 * @help Terms of use: free to use and/or modify for any project.
 */

// Alias! Change the window starting position.
(function(alias) {
    Window_BattleStatus.prototype.initialize = function() {
        alias.apply(this, arguments);   // invoke original method
        this.x = 900;   // change position
        this.y = 850;
    };
})(Window_BattleStatus.prototype.initialize);

// Overrides! Change the window's initial width and height.
Window_BattleStatus.prototype.windowWidth  = function() { return 800; };
Window_BattleStatus.prototype.windowHeight = function() { return 190; };

// Override! Skip the status window movement stuff.
Scene_Battle.prototype.updateWindowPositions = function() {};
Remember to save your project to apply Plugin Manager changes before testing~
The battle scene updates the x position of the status window each frame based on the current battle phase. This updating is done in the updateWindowPositions method of Scene_Battle.

Also, note that you should recreate a window's contents after changing its width/height. If possible, it's better to pass a different size to its initialize method rather than resize it afterwards; for example, in this case you can override the window's windowWidth method to change the width. Otherwise you can invoke the window's createContents method after changing its size.

I would recommend making changes to the core scripts using plugins, not direct edits. RMMV is no longer receiving core script updates, but plugins can be turned on/off at will and are much easier to track (e.g. for support, compatibility, and/or credit purposes). 😮‍💨

Try saving this code as a .js file (or download the attached file) and import it as a plugin:
Spoiler: Suggested plugin code
JavaScript:
/*:[/INDENT]
[INDENT]* @plugindesc Status window edits: change position and stay still.[/INDENT]
[INDENT]* @help Terms of use: free to use and/or modify for any project.[/INDENT]
[INDENT]*/[/INDENT]
[INDENT][/INDENT]
[INDENT]// Alias! Change the window starting position.[/INDENT]
[INDENT](function(alias) {[/INDENT]
[INDENT]    Window_BattleStatus.prototype.initialize = function() {[/INDENT]
[INDENT]        alias.apply(this, arguments);   // invoke original method[/INDENT]
[INDENT]        this.x = 900;   // change position[/INDENT]
[INDENT]        this.y = 850;[/INDENT]
[INDENT]    };[/INDENT]
[INDENT]})(Window_BattleStatus.prototype.initialize);[/INDENT]
[INDENT][/INDENT]
[INDENT]// Overrides! Change the window's initial width and height.[/INDENT]
[INDENT]Window_BattleStatus.prototype.windowWidth  = function() { return 800; };[/INDENT]
[INDENT]Window_BattleStatus.prototype.windowHeight = function() { return 190; };[/INDENT]
[INDENT][/INDENT]
[INDENT]// Override! Skip the status window movement stuff.[/INDENT]
[INDENT]Scene_Battle.prototype.updateWindowPositions = function() {};
Remember to save your project to apply Plugin Manager changes before testing~
Thank you very much for the explanation and the code, appreciate it.

Original thread: https://forums.rpgmakerweb.com/threads/change-window-position.139642/