(1) A party who discontinues or withdraws is liable to pay—(a) the costs of the party to whom the discontinuance or withdrawal relates up to the discontinuance or withdrawal; and(b) the costs of another party or parties caused by the discontinuance or withdrawal.
(2) If a party discontinues or withdraws with the court’s leave, the court may make the order for costs it considers appropriate.