MZ RMMZ execute plugin command when clicking on event

Hi, I know RPG Maker MZ is quite new but I hope someone can help me.
So my problem is that, that I want to execute a plugin command when I click on an event in-game. Bu tI don't know how it is handled.

In RMMV it was something along those lines:
JavaScript:
const _Game_Interpreter_PluginCommand = Game_Interpreter.prototype.pluginCommand;
Game_Interpreter.prototype.pluginCommand = function(command, args) {
    _Game_Interpreter_PluginCommand.call(this, command, args);
    if(command.toLowerCase() === 'myCommand') {
        // execute my code
    }
}

But in RMMZ this is deprecated and I can't find the right command to do the same or similar.
PluginManager.registerCommand is how it's done now.
Thanks a bunch. I already tried it before, didn't work, but now ut works fine. Thought there might be something other. But well. thanks.

Original thread: https://forums.rpgmakerweb.com/threads/rmmz-execute-plugin-command-when-clicking-on-event.126052/