You can create an advanced theme, and override the head_script() function to check for scripts and change the URLs. Something like this:
public function head_script()
{
if (isset($this->content['script'])) {
foreach ($this->content['script'] as $scriptline) {
$scriptline = str_replace('q2a-url', 'cdn-url', $scriptline);
$this->output_raw($scriptline);
}
}
}
Where 'q2a-url' is the local/origin URL, and 'cdn-url' is the address for that URL on the CDN.