I think I've found a fix. I've uploaded the file. Since I don't normally use this yanfly plugin it would help if you could test my plugin against it. What I can say for sure is that my new change stops the crash and my plugin does run while that other plugin is enabled.
Let me know how it goes.
Thank you!