Setting up an NDA can be done for many reasons. I imagine the burden of proof is on the prosecutions to PROVE what Trump's motivation was. Trump can get on the stand and say what his motivations were, and undermine their whole case. In other words, the alleged crime would be entirely based on Trump admitting to motivations the prosecution wants him to admit to. All he would have to do, it not do that.
In other words, Trump spent his own money to set up NDA's, and it happened to be while he was campaigning. So what? Where's the crime? Does everything you spend money on in your life, while campaigning, have to be disclosed as a campaign finance. Does the mouthwash you use, so your breath doesn't stink while you go to a campaign rally, need to be disclosed as a campaign finance? Or, since people commonly use mouthwash even when they aren't campaigning, is it just considered a common life expense? Likewise, NDA money can be seen as a common life expense (for billionaire playboys like Trump).
I'm not trying to get you, or anyone, to like Trump. I'm just explaining the strong strategy his defense team will be able to use if it comes to a hearing/trial.