Haven't dug too deep into it yet, but one thing I noticed is that you have a lot of on('chat:message',...): obj.registerEventHandlers = function() {
on("change:token:bar1_value", updateHealthStatus);
on("change:attribute:current", clearDeathSavingThrows);
on("chat:message", handleModHealth);
on("chat:message", handleToggleConcentration);
on("chat:message", handleToggleRage);
on("chat:message", deathSaveEventHandler);
on("chat:message", hitDiceEventHandler);
on("chat:message", secondWindEventHandler);
on("chat:message", healingPotionEventHandler);
on("chat:message", damageEventHandler);
on("chat:message", songOfRestEventHandler);
};
You might find that you'll have a performance improvement if you change to having a handleInput function to handle all chat messages. This is because all the on('chat:message') lines will be run for each chat message in sequence. This can delay the execution of the function you actually want. Having multiple on's would also cause a lot of duplicate handling and message manipulation.