Maryland Family Law Section 9-306
§ 9-306.
  (a)   If an individual violates the provisions of § 9-304 or § 9-305 of this subtitle, the individual may file in an equity court a petition that:
    (1)   states that, at the time the act was done, a failure to do the act would have resulted in a clear and present danger to the health, safety, or welfare of the child; and
    (2)   seeks to revise, amend, or clarify the custody order.
  (b)   If a petition is filed as provided in subsection (a) of this section within 96 hours of the act, a finding by the court that, at the time the act was done, a failure to do the act would have resulted in a clear and present danger to the health, safety, or welfare of the child is a complete defense to any action brought for a violation of § 9-304 or § 9-305 of this subtitle.