UNIT has finally convinced the Doctor to give its top ranking members, along with some of his old companions, a tour of the TARDIS. However, unbeknownst to them, a group of Zygons (and some other enemies using Zygon tech) have infiltrated UNIT, and manage to make it aboard as well. During the tour the Doctor approaches the Heart of the TARDIS, and that's when the Zygons reveal their presence, attempting to destroy it by deploying a <PLOT DEVICE> that will gradually decompose it.
However, the TARDIS manages to activate one of its many fail-safe mechanisms, halting its destruction by freezing the TARDIS in time, which makes it impossible to exit. The Zygons play one last gambit and deploy some sort of agent that modifies everyone's perception of each other, making everyone unable to recognize themselves.
The TARDIS is damaged and needs the Doctor and his friends' help, but if a single enemy where to sabotage the repairs, it would be destroyed. The Doctor comes up with a plan: Logic the fuck out of who's who, and every 24 hours allow the TARDIS to unfreeze time just for a minute, in order to expel the saboteurs. When there are no saboteurs left, he and his friends will repair the TARDIS before the <PLOT DEVICE> destroys it.