Ai enemy Attack Sequence

This may be an easy or complicated or difficult question but I haven’t found any reliable resources so far. What I’m trying to achieve is a sort of sequence of actions the AI has to perform and abide by. For instance, At the beginning of the fight, the AI will perform a simple attack then go back to idle mode; If it’s attacked, It’ll move to a different location; If it has enough energy, It’ll use a special attack.(Something similar to basic\familiar bosses you see in Mario or sonic games or any rpg game). Is there a proper method to do this?

You are looking for the Behaviour Tree and all that follows. Its quite a long subject.
Here is a tutorial serie (not mine) : Unreal Engine 4 Tutorial - AI - Part 1 The Behaviour Tree - YouTube
Alternatively you can look up “Unreal Engine AI behaviour tree” and so on on google.

In the behaviour tree there are several nodes, including sequence nodes you can configure to play different kind of actions in a preset order and according to various conditions etc. It will do the things you need.

Here is some official doc too :

Good luck and good learning to you!