I know this is an old question but it's something I just had an issue with and couldn't directly find an answer for so I thought I would add what worked for me specifically.
You can use this code to check what animation is currently playing:
$AnimationPlayer.getcurrentanimation()
So for my example I use it as a check because I want my attack animation to play over anything else so before each animation I have this line:
if $AnimationPlayer.getcurrentanimation() != "Attack":
then I would have the code to play whatever animation should be playing without the attack.