[z2199] Add support to toggle UNIT_FLAGS with TemporaryFaction changes

(based on commit [12292] - e835ccd)

(based on commit [s1833] - 607a0da)