When an owner:
the owner shall, after any such event and pursuant to the terms of the written contract, pay to the prime contractor all retainage the owner may have withheld pursuant to the written contract, except any sum which the owner may reasonably withhold in accordance with the written contract between the owner and the prime contractor; the retainage must be paid within ninety (90) days after the date of the occurrence of an event included in subdivision (1), (2) or (3).