Double Points Powerup

I am trying to make a double points powerup and am really close to figuring it out! I created a multiplier in my scoremanager and set it equal to one. When the player collides with the X2 object the multiplier is incremented by 1 (multiplier++). My code works briefly, but then the score starts getting ridiculously high. I decremented the multiplier (multiplier–) after the powerup duration is finished, but that does not seem to work. I would appreciate any help.

Here my code:

Code1:

using UnityEngine;
using System.Collections;

	public class Multiplier : MonoBehaviour {

		public GameObject particle;
		public AudioClip powerUpSound;
		public float time;
	bool Active=false;

	void Update(){

		if (Active==false) {
			StartCoroutine (DestroyGameObject ());
		}
	}

		IEnumerator ScoreMultiplier(){
		
			Active = true;
			ScoreManager .multiplier ++;
			yield return new WaitForSeconds (time);
			ScoreManager.multiplier--;
			Destroy (gameObject);

		}

	IEnumerator DestroyGameObject(){

		yield return new WaitForSeconds (3);
		gameObject.GetComponent <SpriteRenderer > ().enabled = false;
		yield return new WaitForSeconds (17);
		Destroy (gameObject);

	}

		void OnTriggerEnter2D(Collider2D other){

			if (other.tag == "Player") {

				Active = true;
gameObject.GetComponent <SpriteRenderer > ().enabled = false;
				StartCoroutine (ScoreMultiplier ());
}

}

}

Code 2 (Attached to player):

using UnityEngine;
using System.Collections;
using UnityEngine .Audio ;
using UnityEngine .SceneManagement ;

public class Player : MonoBehaviour {

private int Base_Reward1=100;
	private int Base_Reward2=200;
	private int Base_Reward3=300;

public void OnTriggerEnter2D(Collider2D  other){
		
		if (other.tag == "Running Player1") {

			ScoreManager.scoreCount += Base_Reward1*=ScoreManager .multiplier;
Destroy (other.gameObject);

}

}

}

It looks like you might be destroying the score object before it has a chance to decrease the multiplier again.

if I understand correctly, when the player collides with the bonus trigger, the bonus hides its sprite, increases the multiplier, then begins to wait for a little while before decreasing the multiplier and self-destructing.

however, in the player script, you destroy the bonus game object immediately, so that coroutine will stop before it has a chance to decrease the multiplier.

Consider using OnDestroy() to clear the bonus.