And, if you hadn't noticed, Trump can be crass.
Remember how the terrorist attack works, politically. The concept of issue ownership goes back to John Petrocik. There are certain issues, according to Petrocik, that voters simply think that one party is better able to handle. National security is "owned" by the Republican Party, and Trump's tough guy act is an attempt to emphasize that advantage. A terrorist attack could shift the issues that voters think about prior to the election to those that advantage Republicans in general, and Trump specifically.
The problem is that it doesn't work if Trump just comes across as too much of an asshole in the process. Given a month or so, everyone could do the immediate, somber reaction, mourn the dead, and then Trump could go on a tirade about the weakness of the Obama administration and the need for toughness. With only 13 days to go, or less, he wouldn't have the time for any mourning period. He would have to jump right into crass exploitation.
Does anyone remember Orlando? Trump's immediate reaction was to say thanks for congratulating me for being right. Imagine doing that in the face of a 9/11 scale event, less than two weeks before an election.
We may now be too close to the election for even a terrorist attack to save Trump's campaign, Petrocik be damned.