MZ Compatibility issue with Galv Message Styles and Galv Timed Messages

Hi all,

I have a very specific compatibility issue with these plugins:
GALV_MessageStylesMZ (Turning normal textboxes into a speech bubble design).
GALV_TimedMessagePopups + FOSSIL (Adding passive textboxes to spawn above events; they don't hold the game, so you can add sidewalk conversations by NPCs with it, as you walk by).

The setup is shaky already, as they both render speech bubble textboxes, and one of them is an MV plugin running with FOSSIL. But they work well, except for one issue.

If both plugins happen to render a textbox in the exact same frame, the GALV_MessageStylesMZ textbox won't be displayed as a speechbubble but a regular RPG Maker textbox. I have a cutscene, where you talk inside of a noisy crowd, so it happes a few times.

Do you guys have an idea on how to fix it? I'm sure, there is a way, but it's beyond my abilities.
I'd love to fix it in the plugin. Changing the events would be a pain.

Thanks!
I haven't read all of the code but I can tell you where to look.
Perhaps they both modified command101?
This thread was moved from RPG Maker MZ Support to JavaScript/Plugin Support.
I haven't read all of the code but I can tell you where to look.
Perhaps they both modified command101?
Yes, they do. Is there any best practice to approach this?

GALV_TimedMessagePopups
JavaScript:
Galv.Mpup.Game_Interpreter_command101 = Game_Interpreter.prototype.command101;
Game_Interpreter.prototype.command101 = function() {
    var cap = this._list[this._index + 1].parameters[0].match(/<c:(.*)>/i);

    var pos = 2; //this._params[3];
    var data = this._params.clone();

    if (!cap) {
        return Galv.Mpup.Game_Interpreter_command101.call(this);
    } else {
        this.createCaption(cap,pos,data);
        this._index++; // skip the original command101 execution
    };
};

GALV_MessageStylesMZ
JavaScript:
Galv.Mstyle.Game_Interpreter_command101 = Game_Interpreter.prototype.command101;
Game_Interpreter.prototype.command101 = function(params) {
    const ispop = this._list[this._index + 1].parameters[0].match(/\\pop/i);
    if (ispop) {
        // Is a pop message
        Galv.Mstyle.thisEvent = this._eventId;
        Galv.Mstyle.target = Galv.Mstyle.setTarget(Galv.Mstyle.checkTarget(this._list[this._index + 1].parameters[0]));

        if (Galv.Mstyle.target == false) {
            while (this.nextEventCode() === 401) {  // Text data
                this._index++;
            };
            return false;
        };
    } else {
        // Not a pop message
        Galv.Mstyle.thisEvent = null;
        Galv.Mstyle.target = null;
    };
    return Galv.Mstyle.Game_Interpreter_command101.call(this,params);
};
Have you tried changing the order of the two plugins first?
At first I had them this way:
1. GALV_TimedMessagePopups
2. GALV_MessageStylesMZ

I swapped them, and now - I think - the timed message will be dropped if there's a MessageStyle text spawning at the same time. I could live with that. I'll run the cutscene for a couple of times to see if there's anything odd.
Hmm, that's strange. I think I'm getting senile as I can't see any obvious reason why it would happen.

There maybe one place:
return Galv.Mpup.Game_Interpreter_command101.call(this);

This line calls the original function without any arguments, I wonder if it will cause any problem.
Maybe you can try changing it like this:
return Galv.Mpup.Game_Interpreter_command101.apply(this,arguments);

Edit*
MZ:
Game_Interpreter.prototype.command101 = function(params) ...
MV:
Game_Interpreter.prototype.command101 = function() ...

Original thread: https://forums.rpgmakerweb.com/threads/compatibility-issue-with-galv-message-styles-and-galv-timed-messages.174379/