how can i increase rope speed every rope spawn

hi. I want to increase rope speed every rope spawn. because otherwise my game is being easy. i want becloud the game. how can i do this. my code is below.

Spawn Code:

using UnityEngine;
using System.Collections;

public class SpawnScript : MonoBehaviour {

    public Transform prefab;
    public float width = 3;
    public float second = 1;
    private float sum;
    private bool create = true;
    void Update()
    {
        if(create)
            StartCoroutine("CreatePrefab");
    }
   
    IEnumerator CreatePrefab()
    {

        create = false;
        sum += width;
        sum += second;
        Instantiate(prefab, new Vector3(sum, 0, 0), Quaternion.identity);
        yield return new WaitForSeconds(second);
        create = true;
    }
}

SwingForce (Rope Speed)

using UnityEngine;
using System.Collections;

public class SwingForce : MonoBehaviour {

    public float forceStrength = 5.0f;
    public float maxSpeed = 3.0f;
    public float timePerOneSide = 2.0f;
   
    private Rigidbody2D rb;
    private Vector3 force;
    private float timer = 0.0f;
   
    void Start()
    {
        rb = GetComponent<Rigidbody2D>();
        timer = timePerOneSide;
    }
   
    void Update()
    {
        timer += Time.deltaTime;
        if(timer >= timePerOneSide)
        {
            force = new Vector3(forceStrength *= -1, 0, 0);
            timer = 0.0f;
        }
        if(rb.velocity.sqrMagnitude <maxSpeed)
            rb.AddForce(force);
    }

}

When you reset the timePerOneSide, if you wanted to increase after a certain number of ropes, you will need to count the ropes as they spawn & when you reach the number you want reset the count & change the value for timePerOneSide.

how will i do this?? i’m beginner not pro

i wrote this code but then the game giving NullReferenceException: Object reference not set to an instance of an object
SpawnScript+c__Iterator2.Movenext() error.

i wrote this code in SpawnScript. Is it true or not?? :

IEnumerator CreatePrefab()
    {
        prefab.GetComponent<SwingForce>().forceStrength = 10;
        prefab.GetComponent<SwingForce>().maxSpeed = 3;
        prefab.GetComponent<SwingForce>().timePerOneSide = 10;
        create = false;
        sum += width;
        sum += second;
        Instantiate(prefab, new Vector3(sum, 0, 0), Quaternion.identity);
        yield return new WaitForSeconds(second);
        create = true;
    }

anybody help??