Basic Javascript problem

Hey there, i'm new to scripting, can't figure why this is not working
JavaScript:
(function() {
    if(Input.isTriggered('ok')){
        $gameMessage.add("BANG")
    }
})();

I Load the script, press enter in my game and nothing.
Pretty sure that IIFE thing only runs once and never again, so it doesn't do anything. If you wanted to do that you would be better overwriting the original function or alias it with a variable.
Code:
Game_Player.prototype.triggerButtonAction = function() {
    if (Input.isTriggered('ok')) {
      $gameMessage.add("BANG")
        if (this.getOnOffVehicle()) {
            return true;
        }
        this.checkEventTriggerHere([0]);
        if ($gameMap.setupStartingEvent()) {
            return true;
        }
        this.checkEventTriggerThere([0,1,2]);
        if ($gameMap.setupStartingEvent()) {
            return true;
        }
    }
    return false;
};
or
Code:
var inputThing = Game_Player.prototype.triggerButtonAction;
Game_Player.prototype.triggerButtonAction = function() {
   if(Input.isTriggered('ok')){
        $gameMessage.add("BANG")
    }
inputThing.call(this);
}
Pretty sure that IIFE thing only runs once
Damn, i feel stupid now.

Thanks a lot!

Original thread: https://forums.rpgmakerweb.com/threads/basic-javascript-problem.119121/