This is assuming you have the chat applet integrated into your forum. You can do this via a template and a separate php file, or you can use my hack - the vB HTML/ JAVA/ TXT Integrator - which is simple to do - just click on the link in my sig and follow the instructions.
In the chat applet code, where you are meant to put the username, put the variable that I said in the post before.