I know this is a very old topic but I came across this issue in my project and here is how I dealt with it.
I was able to utilize the Instigated By pin and Damage Causer pin off of the Event Anydamage. I chose to do it this way because I knew that there would be several ways of accepting damage (melee, projectile, AoE, DoT) by using the AnyDamage event, it doesn’t really matter how the damage is being done, you just need to know the source of the damage.
I basically compared the actor of class (which in my case was either coming from the parent blueprint of the player character or the parent blueprint from the enemy character)
So for example off the PlayerCharacter blueprint Event AnyDamage, if the Damage Causer was = to the Player Character then the branchy would be True and I left it blank to do nothing. But if they did not equal each other, then go ahead and apply damage.
Then do exactly the same check on your enemy Character AnyDamage event. In 2 to 3 nodes, I was able to avoid friendly fire.