[RPG] Can an Eldritch Knight use the bonus-action attack granted by War Magic before casting the spell as an action

actionsbonus-actionclass-featurednd-5efighter

A Fighter with the Eldritch Knight martial archetype gets the feature War magic at 7th level (and Improved War Magic at 18th level). The War Magic feature (PHB, p. 75) states:

Beginning at 7th level, when you use your action to cast a cantrip, you can make one weapon attack as a bonus action.

The Improved War Magic feature changes "cantrip" to "spell", allowing you to cast a leveled spell as an action and make a weapon attack as a bonus action on the same turn.

Can I use this bonus-action attack before I cast the cantrip (spell)? That is, can I state that I'm going to cast a spell with my action, and thus be granted a bonus action, then use it to make a weapon attack, and then cast the spell as my action?

The rules for bonus action timing state:

You choose when to take a bonus action during your turn, unless the bonus action's timing is specified.

I'm not sure if the wording of War Magic counts as specifying the timing.


Motivation:

If this is possible, it would be especially interesting if used together with the Eldritch Knight's 10th-level feature Eldritch Strike, granting you its bonus on your first action, instead of your second. Eldritch Strike states:

When you hit a creature with a weapon attack, that creature has disadvantage on the next saving throw it makes against a spell you cast before the end of your next turn.

Best Answer

Nope. You only get the bonus action when you use your action to cast a cantrip. You can't use the granted bonus action before you cast the cantrip, because you haven't done the thing that grants it yet.

In case it needs saying explicitly: War Magic does specify the timing of taking the bonus action. It does it by using the word “when”, indicating that it is can only be taken at or after that time. Before that “when” you don't have that bonus action option at all.