MV [SOLVED] windowskin changer that works with yanfly messagecore name boxes?

hello! for my custom message boxes I’m actually using galv’s Message Background instead of windowskins, however I’m using yanfly messagecore’s name windows which use the windowskin, so I’m having to make matching windowskins anyway.
since I’m using multiple different message box styles that change throughout the game depending on circumstance, I’m looking for a plugin that can switch windowskins during the game so the yanfly’s name box matches. is there any such thing? I wasn’t able to get himework’s windowskinchange to work with it.
If you look at that Hime plugin it has like:
WindowLayer.prototype.refreshWindowskins = function() {
var wins = this.children;
But Yanfly Message Core has:
var scene = SceneManager._scene;
scene.addChild(this._nameWindow);
So the name window is on Scene_Map instead of WindowLayer...I think LOL

Add to the Hime plugin that extra line:
WindowLayer.prototype.refreshWindowskins = function() {
var wins = this.children;
for (var i = 0; i < wins.length; i++) {
var win = wins[i];
if (win instanceof Window) {
wins[i].loadWindowskin();
}
}
SceneManager._scene._messageWindow._nameWindow.loadWindowskin(); // EXTRA
};
If you look at that Hime plugin it has like:
WindowLayer.prototype.refreshWindowskins = function() {
var wins = this.children;
But Yanfly Message Core has:
var scene = SceneManager._scene;
scene.addChild(this._nameWindow);
So the name window is on Scene_Map instead of WindowLayer...I think LOL

Add to the Hime plugin that extra line:
WindowLayer.prototype.refreshWindowskins = function() {
var wins = this.children;
for (var i = 0; i < wins.length; i++) {
var win = wins[i];
if (win instanceof Window) {
wins[i].loadWindowskin();
}
}
SceneManager._scene._messageWindow._nameWindow.loadWindowskin(); // EXTRA
};
problem solved, thank you!!
Cool.
Just to make sure, you could put a conditional there to check that the windows exist, like:

if(SceneManager._scene._messageWindow && SceneManager._scene._messageWindow._nameWindow)
SceneManager._scene._messageWindow._nameWindow.loadWindowskin();

Original thread: https://forums.rpgmakerweb.com/threads/solved-windowskin-changer-that-works-with-yanfly-messagecore-name-boxes.181554/