Here is what I recommend:
-Level up a bit
-Get a whole lot of Reviver Seeds(You can return to town by going to the bottom of the mid point screen
-Do as pikachu143 said and turn off all of Chimchar's moves but Flamethrower, but turn them back on when Dialga is in front of you.
-Get a bunch of Sleep seeds and stun seeds. Those helped me alot
-Don't get frustrated just because Roar of Time is pretty much a OHKO.
-Turn off when you lose so you don't lose your itmes
-Be Patient, you will win eventually(It took me at least 20 tries the first time)
That's all I can recommend. Best of luck with kicking Primal Dialga's butt!