Help with Moghunter's Combo Counter plugin

Hey there! I'm trying to use the little js knowledge I have to modify Moghunter's Combo Counter plugin to suit my needs.

What the plugin does is that it tallies up all the damage dealt in a turn and displays it on the screen, for the player to get a clearer picture of how much damage they're actually doing. My problem is that, while intentional for the plugin, the counter resets whenever a party member misses an attack. I'm using a lot of multi hit abilities for my game, and the whole purpose of the plugin seems wasted when in a 4-hit ability, hits 1, 2 and 4 connect while 3 doesn't, and the counter only counts damage for the fourth hit.

I'll link both the plugin and Moghunter's terms of use, so that everyone's aware people are allowed to edit his plugins.

https://atelierrgss.wordpress.com/rmv-combo-counter/
https://atelierrgss.wordpress.com/about/

Thanks in advance!

Original thread: https://forums.rpgmakerweb.com/threads/help-with-moghunters-combo-counter-plugin.91399/