(1) Except as otherwise provided in subsections (4), (5), (6), (8), and (10) of this section, the court shall not modify a prior custody decree or a parenting plan unless it finds, upon the basis of facts that have arisen since the prior decree or plan or that were unknown to the court at the time of the prior decree or plan, that a substantial change has occurred in the circumstances of the child or the nonmoving party and that the modification is in the best interest of the child and is necessary to serve the best interests of the child. The effect of a parent’s military duties potentially impacting parenting functions shall not, by itself, be a substantial change of circumstances justifying a permanent modification of a prior decree or plan. (2) In applying these standards, the court shall retain the residential schedule established by the decree or parenting plan unless: (a) The parents agree to the modification; (b) The child has been integrated into the family of the petitioner with the consent of the other parent in substantial deviation from the parenting plan; (c) The child’s present environment is detrimental to the child’s physical, mental, or emotional health and the harm likely to be caused by a change of environment is outweighed by the advantage of a change to the child; or (d) The court has found the nonmoving parent in contempt of court at least twice within three years because the parent failed to comply with the residential time provisions in the court-ordered parenting plan, or the parent has been convicted of custodial interference in the first or second degree under RCW 9A.40.060 or 9A.40.070. (3) A conviction of custodial interference in the first or second degree under RCW 9A.40.060 or 9A.40.070 shall constitute a substantial change of circumstances for the purposes of this section. (4) The court may reduce or restrict contact between the child and the parent with whom the child does not reside a majority of the time if it finds that the reduction or restriction would serve and protect the best interests of the child using the criteria in RCW 26.09.191. (5) The court may order adjustments to the residential aspects of a parenting plan upon a showing of a substantial change in circumstances of either parent or of the child, and without consideration of the factors set forth in subsection (2) of this section, if the proposed modification is only a minor modification in the residential schedule that does not change the residence the child is scheduled to reside in the majority of the time and: (a) Does not exceed twenty-four full days in a calendar year; or (b) Is based on a change of residence of the parent with whom the child does not reside the majority of the time or an involuntary change in work schedule by a parent which makes the residential schedule in the parenting plan impractical to follow; or (c) Does not result in a schedule that exceeds ninety overnights per year in total, if the court finds that, at the time the petition for modification is filed, the decree of dissolution or parenting plan does not provide reasonable time with the parent with whom the child does not reside a majority of the time, and further, the court finds that it is in the best interests of the child to increase residential time with the parent in excess of the residential time period in (a) of this subsection. However, any motion under this subsection (5)(c) is subject to the factors established in subsection (2) of this section if the party bringing the petition has previously been granted a modification under this same subsection within twenty-four months of the current motion. Relief granted under this section shall not be the sole basis for adjusting or modifying child support. (6) The court may order adjustments to the residential aspects of a parenting plan pursuant to a proceeding to permit or restrain a relocation of the child. The person objecting to the relocation of the child or the relocating person’s proposed revised residential schedule may file a petition to modify the parenting plan, including a change of the residence in which the child resides the majority of the time, without a showing of adequate cause other than the proposed relocation itself. A hearing to determine adequate cause for modification shall not be required so long as the request for relocation of the child is being pursued. In making a determination of a modification pursuant to relocation of the child, the court shall first determine whether to permit or restrain the relocation of the child using the procedures and standards provided in RCW 26.09.405 through 26.09.560. Following that determination, the court shall determine what modification pursuant to relocation should be made, if any, to the parenting plan or custody order or visitation order. (7) A parent with whom the child does not reside a majority of the time and whose residential time with the child is subject to limitations pursuant to RCW 26.09.191 (2) or (3) may not seek expansion of residential time under subsection (5)(c) of this section unless that parent demonstrates a substantial change in circumstances specifically related to the basis for the limitation. (8)(a) If a parent with whom the child does not reside a majority of the time voluntarily fails to exercise residential time for an extended period, that is, one year or longer, the court upon proper motion may make adjustments to the parenting plan in keeping with the best interests of the minor child. (b) For the purposes of determining whether the parent has failed to exercise residential time for one year or longer, the court may not count any time periods during which the parent did not exercise residential time due to the effect of the parent’s military duties potentially impacting parenting functions. (9) A parent with whom the child does not reside a majority of the time who is required by the existing parenting plan to complete evaluations, treatment, parenting, or other classes may not seek expansion of residential time under subsection (5)(c) of this section unless that parent has fully complied with such requirements. (10) The court may order adjustments to any of the nonresidential aspects of a parenting plan upon a showing of a substantial change of circumstances of either parent or of a child, and the adjustment is in the best interest of the child. Adjustments ordered under this section may be made without consideration of the factors set forth in subsection (2) of this section. (11) If the parent with whom the child resides a majority of the time receives temporary duty, deployment, activation, or mobilization orders from the military that involve moving a substantial distance away from the parent’s residence or otherwise would have a material effect on the parent’s ability to exercise parenting functions and primary placement responsibilities, then: (a) Any temporary custody order for the child during the parent’s absence shall end no later than ten days after the returning parent provides notice to the temporary custodian, but shall not impair the discretion of the court to conduct an expedited or emergency hearing for resolution of the child’s residential placement upon return of the parent and within ten days of the filing of a motion alleging an immediate danger of irreparable harm to the child. If a motion alleging immediate danger has not been filed, the motion for an order restoring the previous residential schedule shall be granted; and (b) The temporary duty, activation, mobilization, or deployment and the temporary disruption to the child’s schedule shall not be a factor in a determination of change of circumstances if a motion is filed to transfer residential placement from the parent who is a military service member. (12) If a parent receives military temporary duty, deployment, activation, or mobilization orders that involve moving a substantial distance away from the military parent’s residence or otherwise have a material effect on the military parent’s ability to exercise residential time or visitation rights, at the request of the military parent, the court may delegate the military parent’s residential time or visitation rights, or a portion thereof, to a child’s family member, including a stepparent, or another person other than a parent, with a close and substantial relationship to the minor child for the duration of the military parent’s absence, if delegating residential time or visitation rights is in the child’s best interest. The court may not permit the delegation of residential time or visitation rights to a person who would be subject to limitations on residential time under RCW 26.09.191. The parties shall attempt to resolve disputes regarding delegation of residential time or visitation rights through the dispute resolution process specified in their parenting plan, unless excused by the court for good cause shown. Such a court-ordered temporary delegation of a military parent’s residential time or visitation rights does not create separate rights to residential time or visitation for a person other than a parent. (13) If the court finds that a motion to modify a prior decree or parenting plan has been brought in bad faith, the court shall assess the attorney’s fees and court costs of the nonmoving parent against the moving party.