Definition from the FBI
here:
"Involve violent acts or acts dangerous to human life that violate federal or state law"
Nukes are definitely dangerous, no debate there. Violation of federal and state laws is only there because this is actual legal code for someone who would be prosecuted by us.
"Appear to be intended
(i) to intimidate or coerce a civilian population;"
Scare the Japanese populace to not back the war effort.
"(ii) to influence the policy of a government by intimidation or coercion; or"
Scare the Japanese politicians to not back the war effort.
"(iii) to affect the conduct of a government by mass destruction, assassination, or kidnapping;"
Going to war is part of the conduct of a government, and it definitely qualifies as mass destruction.
There is more to the definition you can read as to whether it is domestic or international (this would of course be international) but there is nothing that is part of the definition that says it has to be an individual, or private organization, or government that is acting.
There is also nothing about "who started it". That has nothing to do with whether something is a terrorist act or not.
And your definition fits as well until you call it self defense, which is has nothing to do with whether it is terrorism or not. I'm not saying the Japanese were good guys at all, not in the slightest. What I say about our conduct has no bearing whatsoever on what I think of their conduct. But we didn't bomb a military installation did we?