How to add to a public float?

I have a public float (which is a timer that decreases) in another script that I want to add a value to through a powerup. The code that I’ve implemented doesn’t seem to do anything.

I was using this tutorial: A Great Way To Setup POWERUPS In Your Unity Game - YouTube

It worked for another powerup, that is an integer, but not for this.

[CreateAssetMenu(menuName = “PowerUps/AddTime”)]
public class AddTime : PowerupEffect
{
public float increase;
public override void Apply(GameObject target)
{
target.GetComponent().startingTime += increase;
Debug.Log(“Added Extra Time!”);
}
}

target.GetComponent().startingTime += increase;

This should’nt work, you must specify which component to get. There are several ways to do it, look in the doc.

But if startingTime is part of the PowerupEffect, you need only assign it

startingTime += increase;

But you also need to use the AddTime class and attach it to the object instead of PowerupEffect? Can you include the code that runs Apply()?