MacGyver is at a helipad waiting for Pete to arrive to greet President Dakru of the African country of Kimbala, who is touring the U.S. to promote a trade agreement. Vice President Edward Mantu is wondering where Pete is. The state representative, Miss Hendrix, is also worried. Pete shows up and apologizes for arriving late. President Dakru arrives on the last stop of his tour. Mantu and his wife Edith are there to greet him. As they prepare to greet him, Pete explains that he took a couple of days off and went fishing. Dakru arrives to thank them for the Foundation's help dealing with his country's drought. Dakru is giving medals to MacGyver and the pilot who helped him: Jack Dalton. MacGyver isn't particularly thrilled at having to go through a ceremony, but Hendrix tells him he has to and to make sure Jack is there.
Jack is walking through a shadowy area as a woman calls out to him. He finds himself in a dining room and a dining table with his name on it. There's also a platter with a gun on it. A figure appears on the dais, holding a glowing star, and the words "from the bottom of my heart I salute you" echo out. Jack shoots the star...
... and finds himself standing barefoot in a puddle at an amusement park. The policeman wonders what he's doing, but Jack has no idea how he got there. Tabur, Mantu's operative, watches from the shadows. The police call MacGyver, who identifies Jack. Meanwhile, Tabur goes to MacGyver's houseboat and plants a bug. He slips out as Jack and MacGyver arrives. Jack explains that he's been out with a woman for the last couple of days, although he never learned her name. He convinces MacGyver to let him sleep in the bed upstairs while MacGyver sleeps on the couch and makes sure he doesn't go sleepwalking again.
Tabur reports to Edward Mantu and his wife that Jack managed to escape. They tell Tabur to keep watch on MacGyver. Edward is worried that MacGyver might learn what is going on. Edith assures him that she's added the special words to Dakru's speech and that the risk will be worth the reward. By the same time the next day, Edward will be president.
Come morning, an entranced Jack walks down the stairs while imagining himself back in the shadowy chamber with the woman calling to him. He walks back into the dining room but this time finds a coffin. MacGyver is standing over it and Jack asks him who's dead. MacGyver says that Jack killed "him" and reveals that Pete is resting in the coffin. Pete looks up at him...
MacGyver wakes up and sees Jack standing, apparently sleepwalking. Jack explains what he saw and MacGyver insists that it's a nightmare. As MacGyver makes him breakfast, Jack sees that he's holding a gun. When he notices MacGyver holding a pitcher with a star on it, he shoots the pitcher... and Jack snaps out of his trance, holding an imaginary gun. MacGyver is still asleep on the couch. Jack wakes him up and worries that he's losing his mind.
MacGyver calls to set up an appointment with Dr. Beatty at the Phoenix lab while outside, Tabur listens in. Jack is reluctant to see a psychiatrist but agrees. Tabur calls Edith and tells her what's going on. She tells him to return to the hospital and then tells her husband what's going on. Edward worries that the psychiatrist might unravel the hypnosis, but Edith assures him that they have another puppet.
As they go outside, MacGyver hears a phone call and goes back inside. Jack wanders over to listen to two fisherman and one of them says "from the bottom of my heart." Jack picks up a bucket of water and puts it on his head and then goes into a trance. Jack snaps out of it and MacGyver takes him inside to change into dry clothing.
At the Phoenix lab, Dr. Beatty runs tests and puts him into a trance. He describes his vision of walking down a hallway through a set of double doors. He describes the room beyond and the gun on the table. He says the room is "in the moon," his name is in gold, and then describes the man on the dais holding the star. However, he can't describe anything further. Doc Beatty has him forget what he's recalling and then asks him what he's done in the last few days. Jack brings up the mystery woman again and uses the exact same words he did with MacGyver earlier. Beatty and MacGyver talk privately and the doctor explains that Jack is suffering from a pre-conditioned response. She's sure he's been brainwashed and explains there's a trigger phrase. Without it they can't learn what he's programmed to do. She tells MacGyver it'll take time and she'll put together the equipment to do it.
Jack and MacGyver go to the building housing the reception and Jack notices that the hallway looks like the one in his dream. They pass through a metal detector and talk to Pete. Hendrix wishes to make sure everything goes without a hitch and Edward introduces himself. He asks for a few minutes alone with Jack to get some memoirs to relate in the speech, and Hendrix calls MacGyver away. Edward recites the key words and then suggests Jack is feeling ill. Jack goes out to get some fresh air and walks down the hallway to where Edith is waiting for him. She recites the key phrase and takes control of Jack, and has him follow her to a nearby room.
Hendrix goes over the protocol with MacGyver, who notices a gold-printed seating card with Jack's name on it. He looks under the table and finds an empty holster fastened to the bottom of the table. MacGyver goes to Pete and asks where Jack is, and explains that Jack is involved in a plan to assassinate President Dakru.
As MacGyver goes to find Jack, Edith gives Jack new orders: to kill MacGyver.
Later, MacGyver checks back with Pete and admits he can't find Jack. MacGyver explains what Beatty said and shows Pete the table. However, someone has taken the holster away. Pete says that only Hendrix, Pete, and his staff have been there, and MacGyver figures that whoever is responsible knows he's on to them. They wonder if Hendrix is involved. Pete stays there to capture Jack if he comes back while MacGyver goes searching for his friend.
Edward brings in the holster, saying the subject got it without noticing. Edith boasts that it's foolish to risk everything on one assassin. She insists that once Dakru is assassinated, it will tear apart the trade arrangement and she'll guide Edward as President and they'll have the support of their new allies.
MacGyver returns to his houseboat and gets a call from Pete. The banquet begins in an hour and Pete suggests MacGyver check out the amusement park where Jack turned up earlier. MacGyver goes there and spots a funhouse with a moon on the top. Remembering what Jack described, MacGyver goes inside and calls out to his friend. The hypnotized Jack hears him and turns on the funhouse machinery. MacGyver falls through a trap door and finds himself in a mirror maze. Moving forward, MacGyver spots a door leading to a chamber filled with a hallway similar to the one at the reception. He enters the fake reception room and finds the seating card with Jack's name. Finally he finds a control booth with a recording of a woman's voice saying "from the bottom of my heart I salute you." MacGyver checks Jack's table and finds the holster fastened underneath. On the stage is a dummy figure representing Dakru, holding a glowing star. Jack enters the room and opens fire. MacGyver ducks behind the dais and tries to get through to his friend. He uses the key phrase and reveals himself, but Jack fires again, grazing him in the shoulder. MacGyver realizes that the programmers changed the key phrase.
The brainwashed Jack closes in on his friend, who crawls to the control panel. He turns on the recording of Edith's voice to draw Jack's attention and manages to get outside. Jack goes after him and enters the funhouse mirror maze. MacGyver reveals himself reflected in the mirror and tells him to shoot. Jack keeps shooting at each reflection, and the mental stress breaks the programming.
At the reception hall, Hendrix wonders where MacGyver and Jack are. Edward says he's written a different version of the speech and asks Pete to accept on their behalf.
MacGyver shows Jack that there are two chairs and that the programmers must have conditioned a second killer. When Jack talks about his weekend, MacGyver realizes that Pete also had a "dream weekend" and has been programmed to shoot whoever holds the star medal.
At the reception dinner, Dakru takes the dais and gives his speech. MacGyver and Jack arrives and Tabur tries to stop them. They knock him aside and enter the reception hall as Dakru recites the trigger phrase that Pete has been programmed with. He pulls out a gun and prepares to shoot but MacGyver arrives, rips the medal out of Dakru's hand, and throws it to Edith. She has no choice but to use the key phrase to stop Pete from shooting her.
Later, Beatty deprograms Pete. As they discuss the key phrases, MacGyver goes into a trance... and they realize he's kidding.