AMMAN, Jordan — The plan was to unleash mayhem across an entire city and “bring Amman to its knees,” in the words of one security official. It would start with suicide bombings at two shopping malls, then build momentum as teams of terrorists blew up cars and raked cafes with machine-gun fire. In the midst of the chaos that would ensue, the attackers would turn their attention to the U.S. Embassy, the primary target and a long-sought prize for the organization that investigators say provided critical support for the scheme: al-Qaeda’s affiliate in Iraq. Using the terrorist group’s expertise and...