MZ Change between window sizes in game

Hello, I'm currently trying to switch between two types of message windows:
- The normal one
- One that covers all screen

I found a way to make the second one by just copying the scroll text rect function and putting it on the message function in rmmz_scenes.jz:

Scene_Message.prototype.messageWindowRect = function() {
const wx = 0;
const wy = 0;
const ww = Graphics.boxWidth;
const wh = Graphics.boxHeight;
return new Rectangle(wx, wy, ww, wh);
}

But that means that I can't go back to the normal one since is a plugin... is there a way to change between both screen sizes without some major plugin like visualstella and similars?
Can't you put a conditional in there, that

if ($gameSwitches.value(X))

it returns your custom sizes, otherwise it returns the normal sizes?
Can't you put a conditional in there, that

if ($gameSwitches.value(X))

it returns your custom sizes, otherwise it returns the normal sizes?
In a plugin no, since it can't initiate the game with a conditional variable value like that, if it worked via script it probably would work but it seems you can't change a variable like that in a event nor in the f12 menu
I'm not on MZ so you should test this:

One approach is to make changes to the new reference created in the scene by the messageWindowRect() method rather than directly writing over the corescript method.

Run this as a script call before you run any commands that create the message window:
JavaScript:
const mWin = SceneManager._scene._messageWindow;
mWin.messageWindowRect = () => new Rectangle(0, 0, Graphics.width, Graphics.height);
To change it back when you are in the same scene, run this script call:
JavaScript:
const mWin = SceneManager._scene._messageWindow;
delete mWin.messageWindowRect;
Ok, it didn't work but I tried changing the height BEFORE the text with:
SceneManager._scene._messageWindow.height = 500

I was trying to change the height like changing the position with the window already created via f12, but changing it before was the secret! Thanks!

Original thread: https://forums.rpgmakerweb.com/threads/change-between-window-sizes-in-game.178350/