I didn't want to resurrect this topic - https://forums.malwarebytes.com/topic/268898-malwarebytes-causes-lags-in-age-of-empires-2-definite-edition/?tab=comments#comment-1431101 - but I had a similar issue, with a slightly different context.
I'd been having issues while running Age of Empires II: Definitive Edition. During offline campaign games vs. AI, every couple of minutes the game would hang momentarily, then continue running. After a fair bit of digging around on different forums, the common thread seemed to be Malwarebytes - apparently AoEII triggers MBAM's real-time ransomware protection for whatever reason. The suggested solutions were: 1) uninstall MBAM (For me, not an option. I think MBAM is an excellent piece of software and I'm not going to switch/pay for a whole different software for one game.), 2) disable MBAM while playing AoEII (To me, this is tantamount to uninstalling. What good is the real-time protection if you're turning it off regularly?), and 3) the user in the other forum post found that adding AoEII:DE's folder to the exclusions/allow list in MBAM solved the issue.
The difference in my situation is that I can't access the game's folder. AoEII:DE is (I assumed all versions, but I guess the Steam version is not) a Universal Windows Platform app, meaning that the program folder itself is within a "WindowsApps" folder that is not further accessible without a non-obvious workaround. I had tried simply adding the whole WindowsApps folder to the exclusions list, to no avail. I stumbled upon another unrelated forum post that discussed how to gain access within the WindowsApps folder:
Go to C:\Program Files\WindowsApps
Right click the WindowsApps folder and select properties.
Click on the Security Tab
Click on the "Advanced..." button
Under Owner - click on change
Click on Advanced
Click on Find now
Look for your login/username
Select your login
Click okay
Below Owner - there will a check box - replace owner on sub containers and objects. Tick/check the box then Select Apply.
Click okay
Functionally what this entails is opening the security properties of the WindowsApps folder and changing owner to your user account from Admin or whatever superuser-type account Windows locks ownership of WindowsApps to. Once doing this, I could navigate inside the WindowsApps folder, select the specific program's folder, and add it to the exclusions list within MBAM. No apparent issues since.
I wanted to share this for a twofold reason: 1) in the hopes that it can assist others having similar issues with AoEII:DE specifically, or UWP apps in general, and 2) to see if anyone sees any major security flaws in using this method that I am not recognizing. I realize that I am circumventing the sandbox that Microsoft has created around UWP apps, but I guess that there is a relatively low chance that changing the permissions as suggested above opens me up to nearly the same vulnerability that turning off real-time protection does.