(a) Except as otherwise provided in subsection (b) of this section, an aggrieved party, upon notifying the party in breach of contract of its intention to do so, may deduct all or any part of the damages resulting from the breach from any payments still due under the same contract.
(b) If a breach of contract is not material with reference to the particular performance, an aggrieved party may exercise its rights under subsection (a) of this section only if the agreement does not require further affirmative performance by the other party and the amount of damages deducted can be readily liquidated under the agreement.