Anyone want to help me with my first plugin?

Alright, so what I'm trying to accomplish is getting the game timer to not abort battles when it comes to a close. To that end, the following works:

Code:
(function() {
var _Game_Timer_onExpire = Game_Timer.prototype.onExpire; 
Game_Timer.prototype.onExpire = function() {

    _Game_Timer_onExpire.call(this);
};
})();

The second step is to make it to where the numbers do not display while you're in battle.

Code:
(function() {

var _Game_Timer_onExpire = Game_Timer.prototype.onExpire; 
Game_Timer.prototype.onExpire = function() {

    _Game_Timer_onExpire.call(this);
};


var _BattleManager_setup = BattleManager.setup;
BattleManager.setup = function(troopId, canEscape, canLose) {
    _BattleManager_setup.call(this, troopId, canEscape, canLose);
    Game_Timer.prototype.stop;
};
})();

This, however, does not work, and it also renders the first portion not working as well.

I realize there are several steps after this, and I don't even know if I'm entirely on the right track, or what problems I'll encounter, such as.... making the timer resume where it was when it stopped. But I'll get there when I get there.

I just need to understand one step at a time, why is this not stopping the timer on battle start and why is it killing my entire JS from working at all?
For a start, "stop" is a function, but you're missing the brackets in the call.
Perhaps:

Code:
var _Game_Timer_onExpire = Game_Timer.prototype.onExpire;
Game_Timer.prototype.onExpire = function() {
   //Don't call onExpire except outside of battle
   if(SceneManager._scene.constructor !== Scene_Battle) {
      _Game_Timer_onExpire.call(this);
   }
};

//Stop Timer and keep track of time?
var _BattleManager_setup = BattleManager.setup;
BattleManager.setup = function(troopId, canEscape, canLose) {
   _BattleManager_setup.call(this, troopId, canEscape, canLose);
   this._keepTrackOfFrames = $gameTimer._frames;
   $gameTimer.stop();
};

//Start timer again?
var _BattleManager_endBattle = BattleManager.endBattle;
BattleManager.endBattle= function() {
   _BattleManager_endBattle.apply(this, arguments);
   $gameTimer.start(this._keepTrackOfFrames);
};

//Don't show timer in Battle
Spriteset_Battle.prototype.createTimer = function() {
    this._timerSprite = new Sprite_Timer();
    //this.addChild(this._timerSprite);
};
Thanks, that's really helpful. I wasn't sure how to keep track of the frames and I would have gotten stuck there. I mean I might have figured it out, but I wasn't sure where I was going to look.

The missing () was a dumb overlook.

Original thread: https://forums.rpgmakerweb.com/threads/anyone-want-to-help-me-with-my-first-plugin.75023/