Where a defendant has a claim against a plaintiff for the recovery of a debt or damages, the claim may be relied on as a defence to the whole or part of a claim made by the plaintiff for the recovery of a debt or damages and may be included in the defence and set off against the plaintiff's claim, whether or not the defendant also counterclaims for that debt or damages.