Identify How The File Got Changed
First off you want to address the problem of how they are getting into your system since a chmod 755 means only the owner (The web server, ie Apache/iis) has access to write to the files therefor something else is doing the written to these files via your CMS/SQL/PHP.
- Identify how they got in... (Check access.logs, server.logs).
- Patch the vulnerability.
If you are on shared hosting then it could be that your web host has weak server side settings and generally others are being infected, I had a similar problem on GoDaddy once even though they denied it. Always make a ticket and have them run their own investigation after all its what your paying for besides hosting... i.e customer support.
Time To Cleanup and Toughen Up
Once you've identified and fixed the problem its time to harden up your ModX Revo site, it's also important to point out that often yes updating to the latest version is a good thing but most often hackers get in by other means (old of date plugins, or just plugins that are poorly designed.. Check these when identifying.
Additionally and finally you want to learn a little more about chmod, while there's nothing wrong with using 755 on your files you could prevent them being written to period by using a 455, Since how often do you edit JS library? You don't so make the owner of these files outside the scope of the web server process and make it 455 meaning that it can't change the file permissions or can the files being written too.. Again chmod should be seen as a last defense once there in, since 755 will only protect you so far.