Accessing each array members individual variable.

Good afternoon all. I'm very well versed with C++, however I'm not quite sure how to implement this functionality into Unity.

I've basically created an array of enemies by using GameObject.FindGameObjectsWithTag. I'd like to know how to get the script component of each enemy and edit the individual enemies health. Apparently GetComponent doesn't quite work with FindGameObjectsWithTag. Obviously I'll be using a for loop, but I can't quite get past the GetComponent at the moment.

Thanks in advance for any help.

I would imagine something like:

//Unity mono
GameObject[] foo = GameObject.FindGameObjectsWithTag("Bar");
foreach ( GameObject bar in foo )
{
    ScriptName script = bar.GetComponent<ScriptName>();
    script.DoSomething(); //must be publicly accessible
}

//Unity js
var foo : GameObject[] = GameObject.FindGameObjectsWithTag("Bar");
for ( GameObject bar in foo )
{
    var script : ScriptName = bar.GetComponent(ScriptName);
    script.DoSomething(); //must be accessible
}

would do the trick. Remember that ScriptName is a type as you define the class in the script in question and as a type, typical scoping rules apply.