hero.say(paladin + " will cast heal on " + lowHPal); // use console.log
hero.command(paladin, "cast", "heal", lowHPal);
hero.command(lowHPal, "shield");
From another topic:
You also have stacking of ifs.
if (lowHPal) {
// code
}
// code
if (enemy && enemy.type == "warlock")
This may sometimes work, but not always… You already know if/ else if /…/ else