Ok time for the detailed explanation.
When you declare any move during your combat move phase that will result in a state of war, you are considered at war. All of your moves must be legal assuming you were at war at the beginning of the turn.
This would have been alot simpler if it was as follows:
At the beginning of your turn you must decide to declare war or not to declare. If you declare then you may make combat moves as you normal would when at war. If you don’t declare then you cannot do anything that would start a war.
Would have the same effect, so just treat it like that.