Range Error Maximum Call Stack Size

Hi all, this may be a simple fix but I am not sure what is causing it.

I recently picked up a project where I left it, and I had a new bug appear. When doing combat, whenever the party loses, I get the subject line error. The plot does have a battle loss as an all but guaranteed event and it pushes the story forward so I would like to keep it. Plus, if the game crashes whenever the party dies there is a problem.

I have looked at other questions on the same error and I can confirm I have no duplicate scripts being run.

The error only appears when Yanfly Automatic Passive States is running. I have tried disabling Death (state 0) from Player and Global with no success. I would like to still use Passive States as they are part of the skill learning system I developed. Any suggestions would be great.
please give us a screenshot of the full console output (F8) when that error happens
additionally, if you have yanfly's plugins, please check if the order is exactly as given on his website - a wrong order will cause a lot of funny or crashing effects from those plugins.

Original thread: https://forums.rpgmakerweb.com/threads/range-error-maximum-call-stack-size.90697/