Dear Mamush, you do not need to change the "VAR simulation codes to VECM"!!!
What you really need to change is your VECM model itself to correaponding
VAR representation. I guess there is some function vec2var() or something
like that (or perhaps you can do it manually.) Once you are done you may
then use VAR simulation code.