Detecting when player swings weapon(s)

So, I have a problem and I don’t know how to write this:
I have two weapons, a switchblade and a sword. What I want to do for the enemy is to detect when either one is swinging a sword for it to dodge. Unfortunately, I don’t know how to write that.

var swordPlay = GameObject.Find("blade").transform.parent.GetComponent(WepProperty).isAttacking; //I have two "blades", so this variable will only get one. When I swing one of the weapons, it's own WepProperty script isAttacking variable will turn true.
        //I'm not sure how I could play GameObject.FindGameObjectsWithTag() into this dilemma because I'll need to use a for() statement and i don't think it would be a good idea to do so, unless if you know how to make it work well
    
    //I have variables already defined also, and you don't need to check the script for errors 
        if(!swordPlay || (swordPlay && range >= backrange)){ //approaching player
        	transform.LookAt(player.transform);
        	var moveDirection:Vector3 = transform.TransformDirection(0,0,1);
        	moveDirection.y -= gravity;
        	controller.Move(moveDirection*Time.deltaTime*speed);
        	db = 0;
        }
        else if(swordPlay && range <= backrange && relativePoint.z > 0.0){ //dodging player when he swings his weapons
        	transform.LookAt(player.transform);
        	var backwards:Vector3 = transform.TransformDirection(randomdodge);
        	backwards.y -= gravity;
        	controller.Move(backwards*Time.deltaTime*speed);
        }

I believe you can achieve this by getting all WepProperty components of the player and testing isAttacking of each:

var weaponInfos = GameObject.Find("player").GetComponents(WepProperty) as WepProperty[];
if(weaponInfos[0].isAttacking || weaponInfos[1].isAttacking)
{
	// dodge
}

I assumed here, that the player always has two WepProperty components.

Btw - I believe it’s a good idea, to do GameObject.Find(“Player”) once (in Awake or Start) and store the result in some variable. If player object can be destroyed and recreated, then the variable should be reinitialized.

EDIT: By “player” I understand GameObject that you find using

GameObject.Find("blade").transform.parent

EDIT 2:

Oops - sorry - mistake in my code. You have to use:

var weaponInfos = GameObject.Find("player").GetComponents(WepProperty);
var weaponInfo1 : WepProperty = weaponInfos[0];
var weaponInfo2 : WepProperty = weaponInfos[1];

if(weaponInfo1.IsAttacking || weaponInfo1.IsAttacking)
{
	// dodge
}

In my previous code casting to WepProperty caused weaponInfo to be null (it is invalid cast, because GetComponents in JavaScript always return Component).

I suggest retrieving weapon components once, and storing them for later use. Just like I suggested to store player variable above.