Sorry, I partially misspoke earlier: if you canCast chain-lightning you will never do bash/attack.
The canCast is actually the problem in your code.
You never cast chain lightning unless there is a distant yak. No yak == no chain-lightning . . . Good thing you are probably wearing the silly twilight glasses…
I had a hard time getting pauses that I couldn’t blame on other things. Mainly, the “canCast” since I can’t see yaks from the center, my hero does nothing except summon, cleave, and zap until I get around a corner and can see yaks, then I get to chain and can start attacking. Once I fixed the canCast logic the only pauses I got were because I couldn’t see any enemies.
You should probably have have a canElectrocute(enemy) on your if isReady-electrocute (though this shouldn’t really matter on this level).
(shield: if melee enemy far away shield does nothing for you. Just so we are clear, I believe shield is a waste if not used “continuously”, but then I usually write my code in clojure where shield is somehow totally worthless period. So maybe I’m biased…)
Question - why do you care about yaks if you are using chain-lightning but not if you are cleaving?