I have a similar problem. I almost failed out of school because of it. I can't really offer any other suggestions that haven't been talked about above. I personally find that when I start to slip away. I need to verbally remind myself who I am, where I am and what I have to do.
Hope you find something that works