You can do it, but you need the “hwprefs” command-line utility installed. You can get this by installing the CHUD tools that are located in the Developer Tools, under the Performance directory.
To disable one processor,
do shell script "hwprefs cpu_count=1" user name "shortname" password "myPassword" with administrator privileges
and to reenable it
do shell script "hwprefs cpu_count=2" user name "shortname" password "myPassword" with administrator privileges
Also to set the processors to energy saving,
do shell script "sudo pmset -a reduce 1" user name "shortname" password "myPassword" with administrator privileges
and to reset to non-reduced power,
do shell script "sudo pmset -a reduce 0" user name "shortname" password "myPassword" with administrator privileges
To retrieve the reduced-power setting, use
do shell script "sudo pmset -g | grep -m1 reduce | awk '{print $2}'" user name "shortname" password "myPassword" with administrator privileges
then you can assign it to a variable and use that to set the power setting to make it a toggle.
set reduced to (do shell script "sudo pmset -g | grep -m1 reduce | awk '{print $2}'" user name "shortname" password "myPassword" with administrator privileges) as integer
set powerSetting to (((reduced is not 1) as integer) as string)
set procs to (reduced + 1) as string
do shell script "sudo pmset -a reduce " & powerSetting user name "shortname" password "myPassword" with administrator privileges
do shell script "hwprefs cpu_count=" & procs user name "shortname" password "myPassword" with administrator privileges
That will read the “reduced power” setting, and if it is reduced, it will (set it to not reduced, and set the processors to 2). If it is not reduced, it will (set it to reduced and set the processors to 1).