Whenever any portion of the militia, including the army or air national guard, is on active service pursuant to the order of the governor, or is on duty or ordered to assemble for duty in time of war, insurrection, invasion, public danger, or to aid the civil authorities on account of any breach of the peace, tumult, riot, resistance to the process of the State, or imminent danger thereof, or while engaged in disaster relief or for any other cause, the Hawaii Code of Military Justice and rules adopted to administer and implement that Code, shall be enforced and regarded as a part of this chapter until the forces are relieved from duty.