I use a 250watt hps in my closet for flower, my dimensions are 4 feet wide, 2 feet deep, and 6 feet tall and it has sliding doors. I have no air conditioner inside or anything in fact what I've done is stuck 2 normal 10 inch fans and 1 15 inch fan inside, I keep the doors in the middle so that both ends are open for airflow as well. One of my ten inch fans sits in the bottom left opening in order to suck in some air, then on the right side, I have the 15 inch fan elevated to be even with the plants while it blows air out the right side of the closet. Above that theres a shelf that I attached my HPS to, on the top part of this shelf I placed the other 10 inch fan. Even with all of these fans, the room temp will still be around 82-87 during the day where I live(I run it during the day because its my bedroom closet.) I can also manage my temp a bit further due to having an air vent for the ac that blows out directly above the left side of my closet. All it really takes is some craftiness.
If you're running a 400watt the you DEFINITLY will be needing proper ventilation, in a closet especially. The only thing I could think of for you is LOTS of fans. Also try running your light at night simply because outside temps are cooler.
On another note
I was actually in home depot and lowes today picking some supplies up for my grow, and I noticed that BOTH lowes AND home depot carry small AC units for as little as $99.00 which shouldnt be a problem seeing as a 400w usually goes for about 150-250. Then again this is only if you have one of these stores nearby. If not you should check around at other similar stores.
You could also check out Cooltubing options, but they usual cost a bit. Some people make their own from what I've seen though. Google it if you don't know.
I don't know what you're closet looks like and what exactly you're working with from reading your post but if you should post better info about what size closet it is and all that , I'm sure others could help better as well.