MZ Change the message box animation

Heyas - As of right now, all the message windows in MZ start with this little animation where the window itself is squashed together and then grows outwards, and vice versa for when the window disappears again.

I'm looking for a way to to change this animation into a simple fadeIn/fadeOut that just changes opacity. It doesn't have to be as long as the default animation, too.
This setting is needed for:
- Message Window
- Choice Window
- Name Window

Funnily enough, the exact same thing was requested for MV (and better explained, too) a couple of years ago. But the link for that Plugin is dead, and even it weren't, I have no idea if it would work for MZ like that.
Old MV Request

If anyone could make this happen, I'd be very thankful for it!
I just wrote a couple of short plugins (see attachments):
  1. Affects all windows
  2. Affects only the message, choice, and name input windows.
Option 2 can easily be extended to other window classes if needed.

I did a quick test for each and they seem OK; full code in spoilers below.
Spoiler: Plugin 1 (all windows)
JavaScript:
/*:
 * @target MZ
 * @plugindesc Change the window open/close animation to fade in/out.
 * @author Caethyril
 * @url https://forums.rpgmakerweb.com/index.php?threads/141057/
 * @help Simply remaps openness to affect opacity instead of y-scale.
 * Affects all game windows.
 * 
 * Terms of use: free to use and/or modify for any project!
 */

Object.defineProperty(Window.prototype, "openness", {
    get: function() {
        return this._openness;
    },
    set: function(value) {
        if (this._openness !== value) {
            this._openness = value.clamp(0, 255);
            if (!this._background && !this._dimmerSprite?.visible) {
                this.opacity = this._openness;
            }
        }
    },
    configurable: true
});
Spoiler: Plugin 2 (only message, choices, and name input windows)
JavaScript:
/*:
 * @target MZ
 * @plugindesc Change the window open/close animation to fade in/out.
 * @author Caethyril
 * @url https://forums.rpgmakerweb.com/index.php?threads/141057/
 * @help Simply remaps openness to affect opacity instead of y-scale.
 * Affects Window_Message, Window_ChoiceList, and Window_NameEdit.
 * 
 * Terms of use: free to use and/or modify for any project!
 */

[Window_Message, Window_ChoiceList, Window_NameEdit].forEach(w =>
    Object.defineProperty(w.prototype, "openness", {
        get: function() {
            return this._openness;
        },
        set: function(value) {
            if (this._openness !== value) {
                this._openness = value.clamp(0, 255);
                if (!this._background && !this._dimmerSprite?.visible) {
                    this.opacity = this._openness;
                }
            }
        },
        configurable: true
    })
);

[Edit: added this._background check to account for Transparent message/choice window backgrounds. this._background alone is generally insufficient because most windows do not set that value. Attachments updated.]
I just wrote a couple of short plugins (see attachments):
  1. Affects all windows
  2. Affects only the message, choice, and name input windows.
Option 2 can easily be extended to other window classes if needed.

I did a quick test for each and they seem OK; full code in spoilers below.
Spoiler: Plugin 1 (all windows)
JavaScript:
/*:
 * @target MZ
 * @plugindesc Change the window open/close animation to fade in/out.
 * @author Caethyril
 * @url https://forums.rpgmakerweb.com/index.php?threads/141057/
 * @help Simply remaps openness to affect opacity instead of y-scale.
 *
 * Terms of use: free to use and/or modify for any project!
 */

Object.defineProperty(Window.prototype, "openness", {
    get: function() {
        return this._openness;
    },
    set: function(value) {
        if (this._openness !== value) {
            this._openness = value.clamp(0, 255);
            if (!this._dimmerSprite?.visible) {
                this.opacity = this._openness;
            }
        }
    },
    configurable: true
});
Spoiler: Plugin 2 (only message, choices, and name input windows)
JavaScript:
/*:
 * @target MZ
 * @plugindesc Change the window open/close animation to fade in/out.
 * @author Caethyril
 * @url https://forums.rpgmakerweb.com/index.php?threads/141057/
 * @help Simply remaps openness to affect opacity instead of y-scale.
 * Affects Window_Message, Window_ChoiceList, and Window_NameEdit.
 *
 * Terms of use: free to use and/or modify for any project!
 */

[Window_Message, Window_ChoiceList, Window_NameEdit].forEach(w =>
    Object.defineProperty(w.prototype, "openness", {
        get: function() {
            return this._openness;
        },
        set: function(value) {
            if (this._openness !== value) {
                this._openness = value.clamp(0, 255);
                if (!this._dimmerSprite?.visible) {
                    this.opacity = this._openness;
                }
            }
        },
        configurable: true
    })
);

Works like a charm, thank you so much!
Great! I discovered that my original suggestion had a visual bug: it made all Transparent message & choice windows become visible. I updated the code & attachments in my previous post with a fix. I guess you're not using that display type, but I thought I'd mention it anyway~

Happy RPG Making! 😂

Original thread: https://forums.rpgmakerweb.com/threads/change-the-message-box-animation.141057/