I'd actually describe it as a war crime rather than terrorism (i.e. Hiroshima). But in this day and age, war has rules, and you can't just attack civilians with impunity - it's called a war crime, whichever side you're on. The bombing of civilians in Hiroshima was not necessary for the winning of WW2. There was no valid military target. The war had already been won.
Again, the use of the word "terrorism" can be confusing, because according to you, killing civilians is not terrorism if one is already at war, so the Muslims alleged to have committed terrorism on 9/11 might have already declared war on America, making their alleged actions legitimate acts of war (according to your definition). Hence the definition of war crimes in the international community, so whether war is declared or not, soldiers can't just go around killing and raping civilians with impunity.