Except as otherwise provided in Section 3424 or by any other law of this state, if a court of this state has jurisdiction under this part because a person seeking to invoke its jurisdiction has engaged in unjustifiable conduct, the court shall decline to exercise its jurisdiction unless one of the following are true:
The parents and all persons acting as parents have acquiesced in the exercise of jurisdiction.
A court of the state otherwise having jurisdiction under Sections 3421 to 3423, inclusive, determines that this state is a more appropriate forum under Section 3427.
No court of any other state would have jurisdiction under the criteria specified in Sections 3421 to 3423, inclusive.
If a court of this state declines to exercise its jurisdiction pursuant to subdivision (a), it may fashion an appropriate remedy to ensure the safety of the child and prevent a repetition of the unjustifiable conduct, including staying the proceeding until a child custody proceeding is commenced in a court having jurisdiction under Sections 3421 to 3423, inclusive.
If a court dismisses a petition or stays a proceeding because it declines to exercise its jurisdiction pursuant to subdivision (a), it shall assess against the party seeking to invoke its jurisdiction necessary and reasonable expenses including costs, communication expenses, attorney’s fees, investigative fees, expenses for witnesses, travel expenses, and child care during the course of the proceedings, unless the party from whom fees are sought establishes that the assessment would be clearly inappropriate. The court may not assess fees, costs, or expenses against this state unless authorized by law other than this part.
In making a determination under this section, a court shall not consider as a factor weighing against the petitioner any taking of the child, or retention of the child after a visit or other temporary relinquishment of physical custody, from the person who has legal custody, if there is evidence that the taking or retention of the child was a result of domestic violence against the petitioner, as defined in Section 6211.