Building Enemy Ai. Question about block breaking

My question is when I play games PVE the enemies will sometimes m1 me until my shield breaks but other times it will use like it’s block breaker ability or smthn. What conditionals should i be using so that my npc will m1 or block break. Lmk if i need to clarify and ill send an example video.