(a) In all civil actions, including, but not limited to, actions brought pursuant to Section 21167 of the Public Resources Code, brought by any plaintiff to challenge a housing project which is a development project, as defined by Section 65928 of the Government Code, and which meets or exceeds the requirements for low- or moderate-income housing as set forth in Section 65915 of the Government Code, a defendant may, if the bringing of the action or the seeking by the plaintiff of particular relief including, but not limited to, injunctions, has the effect of preventing or delaying the project from being carried out, apply to the
court by noticed motion for an order requiring the plaintiff to furnish an undertaking as security for costs and any damages that may be incurred by the defendant by the conclusion of the action or proceeding as the result of a delay in carrying out the development project. The motion shall be made on the grounds that: (1) the action was brought in bad faith, vexatiously, for the purpose of delay, or to thwart the low- or moderate-income nature of the housing development project, and (2) the plaintiff will not suffer undue economic hardship by filing the undertaking.
(b) If the court, after hearing, determines that the grounds for the motion have been established, the court shall order that the plaintiff file the undertaking in an amount specified in the court’s order as security for costs and damages of the defendant. The liability of the plaintiff pursuant to this section for the costs and damages of the defendant shall not exceed five
hundred thousand dollars ($500,000).
(c) If at any time after the plaintiff has filed an undertaking the housing development plan is changed by the developer in bad faith so that it fails to meet or exceed the requirements for low- or moderate-income housing as set forth in Section 65915 of the Government Code, the developer shall be liable to the plaintiff for the cost of obtaining the undertaking.