Using a variable value with GetComponent

Hi to all!
I’m working on a top-down shooter, and i’m doing good, but till now I didn’t care about the code repetition, and I made 5 powerups with pretty much the same script, with some little differences.
What I want to do now is to make a single script, who takes all the references it needs, and calls the right methods to apply the right powerup.
To activate bonuses, I’m trying to use a simple code like this one:

public void BonusON(string bonusName)	
{	
        bonusDuration = GameObject.FindGameObjectWithTag(bonusName)
		.GetComponent<scriptName>.bonusDuration; 

       //other code	    
}

What i’m trying to do is to reproduce something I saw while I was learning PHP, like dinamically obtaining a variable name using another variable value, then use the variable name to call a different method I prepared before… I made a research online to find if this way could be used in c# as well, but without luck.
What I surely need to know is if there’s a way to use the GetComponent method as I wrote above, so giving it a variable and letting it use that variable value as a component name.

Or, if there’s a simpler way, of course.

Above code should work, except you’re missing brackets for actual function call on GetComponent method:

bonusDuration = GameObject.FindGameObjectWithTag(bonusName).GetComponent<scriptName>().bonusDuration; 

I would suggest against using “Find” functions within gameplay time, though, official docs say it’s quite slow and can cause performance hiccups. Use any other method of obtaining a solid reference, for example if you’re activating something while colliding with it, obtain the reference to the object via Collision argument.

Or if at all possible, use public variables and assign references via Inspector.