If it is possible I would have it attack the target with the least hit points remaining but allow the player to control it, and once the player has issued that command, have it not deviate until the target is destroyed, out of range, or the player manually chooses a new target.