Game crashes because of healthbar scripts

I got a weird game crashing error.
I think it appears because I combined V.M's Healthbars script and his Sleek Gauges script.
I don't know exactly why it happens, but it happens when a enemy gets defeated with one hit or by the "Change Enemy HP" function. Here's the error message and the line of the Healthbars script that gets pinned (170):
Unbenannt.PNG

Unbenannt1.PNG

If it can help: I already tried switching the scripts places in my script editor. Healthbars is now below Sleek Gauges.
Has to be another issue or script. I just tested those two together and there are no issues in my test demo.
I think it also has to do something with the scanning and with the number and gauges counting down.
In my game a enemy gets scanned via status effect for 1 turn after a attack. Also, here are the options I made:

Healthbars:
Unbenannt1.PNG

Sleek Gauges:
Unbenannt2.PNG
HP Bar script already requires the Sleek Gauge script to work, so you're not wrong.
However, the Sleek Gauge script is coded wrong. Try to put this little patch below Sleek Gauge (or both, doesn't matter)
Code:
class Window_Base
  def gauges
    @gauges ||= {}
  end
end
See if that fixes the issue.
YES! It works now. Thank you. I think it also was because of my general script order. I changed it a little bit. Oh, and I think you ment that Sleek Gauges requires HP Bars? Because then you wrote it opposite.
Oh, and I think you ment that Sleek Gauges requires HP Bars? Because then you wrote it opposite.
No, exactly what I wrote.
HP Bar lite won't work without the Sleek Gauge script. It has a code that only present in Sleek Gauge.
Then I don't use Lite. I can use HP Bars without Sleek Gauges.
Healthbars:
Do you also have a modified version? The Constant USE_STATES is not in the original script.
Well the descriptions says this:
Unbenannt.PNG

And as I said, I can use states. SO I guess it's modfied.
SO I guess it's modfied
No it's not. The Lite version has that in it, You said you were using the full version since you could use it without the other script. But I also can use it without the sleek gauges.
Then I don't use Lite. I can use HP Bars without Sleek Gauges
I tried the lite version without TheoAllen's addon and didn't have an issue. Must be slight differences from you project to my test project.
I tried the lite version without TheoAllen's addon and didn't have an issue. Must be slight differences from you project to my test project.
It may or may not trigger the error. In some rare cases, it may trigger the error. There is a possibility that the variable @gauges hasn't been yet initialized and being referenced in the HP Bar which may result in an error. However, I don't want to investigate why as I could just remove the possibility by adding the patch.
Alright.

I've moved this thread to Script Support. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/game-crashes-because-of-healthbar-scripts.122198/