If Middle Eastern terrorists attacked Costa Rica or North Korea

It’s not one of the specific countries asked about, but Kenya has been the victim of international terrorism by al-Qaeda and al-Shabab, via the 1998 embassy bombing (which also hit Tanzania) and the 2013 Westgate mall attack. In general, it responded via a closer partnership with the US in anti-terrorism matters.

The US responded to the embassy bombing with cruise missile attacks on various targets in Sudan and Afghanistan, including most notably a pharmaceutical factory. Also, the US killed the reputed leader of the Westgate attack with a drone.

Such as, any Costa Ricans or Nicaraguans caught in the attack (Nicaraguans are a big immigrant group).