MV Add a clause to this javascript function

I was very pleased to get a resolution to this: https://forums.rpgmakerweb.com/inde...padding-just-on-one-side.151627/#post-1303078 which allowed me to pad icons on one side, so the icons aligned properly in my show text commands etc.

alias_Window_Base_drawIcon = Window_Base.prototype.drawIcon; Window_Base.prototype.drawIcon = function(iconIndex, x, y) { alias_Window_Base_drawIcon.call(this, iconIndex, x, y + 13); };

However, in some windows this extra 13 px padding now throws the icon alignment off too much. For example, on the battle screen.
Does anyone know what the code will be too add to the above to say

"If not in battle screen, run the above code, otherwise - carry on as default normal"

Many thanks
Try the following:
JavaScript:
alias_Window_Base_drawIcon = Window_Base.prototype.drawIcon;
Window_Base.prototype.drawIcon = function(iconIndex, x, y) {
  if(SceneManager._scene instanceof Scene_Battle)
    alias_Window_Base_drawIcon.call(this, iconIndex, x, y);
  else
    alias_Window_Base_drawIcon.call(this, iconIndex, x, y + 13);
};
The other approach would be to create methods for the specific window types that only appear in battle so that they're referenced instead of the parent Window_Base method (e.g. Window_BattleSkill.prototype.drawIcon) and have the original code without extra padding in there.

But that's just a kind of technical mention, not something that's efficient to do for your case. I'd also do what eomereolsson did.
Bingo! Thank you.
And I can see how to add more if clauses, such as for the Scene_Equip. Solved, thank you!!!

Original thread: https://forums.rpgmakerweb.com/threads/add-a-clause-to-this-javascript-function.152249/