change value with a damping

Hi
I am newbee for unity, now I want to change one object’s speed from 10 to 1 every time my mouse over the object.
here is my code:

function Update ()
{
var targetRotation = Quaternion.LookRotation(target.position - transform.position,Vector3.up);
transform.rotation = Quaternion.Slerp(transform.rotation, targetRotation, Time.deltaTime*1.0);
swim(swimmingSpeed);

//runAway();
//swimmingSpeed=Mathf.Lerp(10,0,Time.deltaTime*);
ray = Camera.main.ScreenPointToRay(Input.mousePosition);
    if(Physics.Raycast(ray, hit))
    {
    //collider.isTrigger = true;
      print(hit.collider.name);
      runAway();
    }
function runAway()
{
   
       swimmingSpeed=Mathf.Lerp(10,1,Time.deltaTime);
 
}

`

For what you are doing here, you can change line 19 to:

   swimmingSpeed=Mathf.Lerp(swimmingSpeed,1,Time.deltaTime * reductionSpeed);

…where ‘reductionSpeed’ is a variable you declare and initialize. Start by assigning it a value of 3.0.