disabling a function inside another script

hi

i have a c# script that acesses a java script, and gets it to preform a certain functoin inside of the java script. now i want it so that i can also disable the function at certain conditions, so how would i disable a functoin inside of the java script using the c# script. ( thats probably sounds unclear what i am trying to say is that i am coding inside c# script and acessing a java script, i wana disable a function inside the java script for certain conditions.hopefuly thats more clear)

can anyone tell me what command i would need to use?

Roll your own:

var DisableFunction : Boolean = false;

function MyFunction()
{
	if (DisableFunction != false)
	{
		//do stuff
	}
}


public class MyCSharpClass : MonoBehaviour
{

	public void SomeMethod()
	{
		MyJSClass target = //get target JS
		target.DisableFunction = true;
	}
}