GetComponent once, then track the changes. Static is “bad” unless you want a single variable being referenced in many scripts.
The variables you’re tracking should be public (default in UnityScript, necessary in C#).
Edit: To get a component, you’ll need to have a reference of the gameObject. You can accomplish this with a GameObject.Find() or GameObject.FindWithTag().
You can access this script and pass the script you want as a parameter as well.
I don’t know how to do this in UnityScript, but in C# you’ll use something like this:
using UnityScript;
using System.Collections;
public class YourScript : MonoBehaviour {
private int a;
public int A {
get { return a; }
set { a = value; }
}
}