What can you do for them? From what I've read, half of them had a warped sense of reality that made them feel like something they weren't actually, such as a loser. Maybe an amount of them could get mental attention, but some of these guys seem so convinced of their thoughts that they'd never attribute their beliefs being due to some illness. Those sorts wouldn't reach out for help and end up killing anyway. Then there's the ones who don't have any visible illness, just a belief that they act on like Dylan Roof.
Imo, it's actually a bit unfair to say half of them are ill as well. They just derive different conclusions than someone else would. Conclusions that implicate them being the victim or there being an evil they have to fend off. Normal people constantly do this as well. For example, beef. It usually starts with someone shitting on another person, then the perp goes on as if he was disrespected first or something. The only difference is that the shooters are willing to take their revenge further. I think people lose sight of the most general solution when they try to search for a commonality that only shooters share. The best, general solution for shooters of all kinds is target the general population's view on violence.
This is where people draw inspiration to say video games are bad or to stop glorifying shooters, but I think these two things mean nothing. These people aren't just randomly killing, they want a victory. Why is killing the enemy considered a victory in games to begin with? Because it's derived from what we already understand. History itself defines what a victory is, and those victories are rarely without violence. Just like loser is stigmatized by society, so is victory. I think we as a collective should stop glorifying violent triumphs in general and it includes the army alongside history. Men would beat up other men for their money before selling their body in exchange for it, and it's because of how it's stigmatized. Both should be a success, but one option is more degrading and it's not the violent one. Violence should have a worse stigma than it currently does.