[12402] Add support to toggle UNIT_FLAGS with TemporaryFaction changes

(based on commit [12292] - e835ccd)