Most efficient way for hit detection (Unity 3D) and general questions

I’m currently looking for the most efficient way for hit detection for my game. The hit detection only occurs during an attack and only occurs once per attack for each enemy hit. The current method I’m trying to use is through animator events where I toggle the hit detection to on and off. However, I’m having some issues passing the variable to this enemy script.

-Could it be that the animator event only passes the variable to my player character?
-What is the least performance heavy method for hit detection? Changing collider layers, tags, toggling/hiding [weapon] colliders.
-What are some things I should avoid? i.e. excessive use of Update functions.

using UnityEngine;
using System.Collections;
using System.Collections.Generic;

public class EnemyCollision: MonoBehaviour
{
AudioSource EnemyHurt;
public bool canHarm;
private void Start()
{
    EnemyHurt= GetComponent<AudioSource>();
}
private void OnCollisionEnter (Collision collision)
{
    if(canHarm == true)
    {
    EnemyHurt.Play();
    Debug.Log(canHarm)
     }
}
    public void ToggleHarm()   //This function is toggled inside the animation events.
    {      
        canHarm = !canHarm;
        Debug.Log(canHarm);
    }    
}

To pass variables between scripts, which are components, you need to use
GetComponent();
Scripts are a special component, because all names are unique, unlike (say) AudioSources. So the variable in your script that references it needs to be of type scriptName.

Put at the top:
scriptName myScript;
GameObject objectWithScript;

in Start:
myScript = objectWithScript.GetComponent();

Make a public gameObject and drag the object with the script you want into it. Now you can access all public variables and methods in it with

myScript.variable1 = 50;
myScript.someMethod();

Once you see how to pass things around, it becomes an organizational issue: what scripts are going to manage which parts of the overall game logic. I usually have a large master script which handles most things, and smaller scripts on various objects that do internal changes to them (that the master script doesn’t need to know about).

Thank you very much, I’m using this for my enemy to player script at the moment with the intention of using a master script once I get this to work.

Would it be possible to use this reliably for multiple objects using the same script for the part below?

GameObject objectWithScript;