ZeroDivisionError when using Yanfly Battle Engine

So I've been running into this issue and I have yet to find a solution, nor have I encountered this problem before when futzing around with Yanfly scripts in the past.

I attempted to add Yanfly's Battle Engine to my project, then playtested a simple "training dummy" battle to see how the layout looked with some other scripts I'm using. However, after slaying the single training enemy in the troop, I get the following error:

unknown.png


When I looked at the script to see what could be wrong, this is the line that seems to be causing issues:

Code:
  def row
    index / col_max
  end

I'm not sure what to do to fix this, since I know literally nothing about Ruby code. All I know how to do is work with scripts and tweak them according to what they already have available.

The list of scripts I'm using are:
  • Yanfly: Core, Battle, Equip, Victory Aftermath, Status Menu, System Options, Class System (with Class Specifics and Class Level Unlock)
  • Victor Sant: Core, SFonts
  • Modern Algebra: ATS Face Options, ATS Message Options, ATS Formatting, Customizable Menu, Quest Journal, Monster Catalogue
  • Euphoria: Hurt Faces
  • Typhon01: Remove Blinking Cursor
Is there some sort of conflict between my scripts? I have a very particular idea in mind for my project and I would really prefer to be able to keep using the scripts I picked out. Any help would be much appreciated.
I haven't identified the problem. But it generally occurs when you speed up the battle, like mashing the button to skip the aftermath or so. But mainly occurred when you press instant win button from Yanfly Battle Engine (F8)

However I made a patch as a foolproof for this case. Because, screw debugging. It works anyway
Code:
class Window_Selectable
  def row
    index / col_max rescue 1
  end

  def row_max
    [(item_max + col_max - 1) / col_max, 1].max rescue 1
  end

  def item_width
    (width - standard_padding * 2 + spacing) / col_max - spacing rescue 1
  end
end
Moved to: RGSSx Script Support

Original thread: https://forums.rpgmakerweb.com/threads/zerodivisionerror-when-using-yanfly-battle-engine.90951/