NPCs always use the abilities with the highest priority. If an ability is not available (because it is still on cooldown or the conditions are not met), then the NPC tries to use the ability with the second-highest priority, and so on.