I do this with a program. I usually have main attack (and other skills on RMB) and since the behavior a default attack bound to RMB is not optimal as you have noticed, I make RMB press LMB instead.
some_config.ini
for GDAutocaster:
[general]
suspend_key=Tab
[combo holds]
combo1=RButton:LButton
(you can suspend this with Tab in this config)
alternatively in a simple AutoHotkey you can do
some_ahk_script.ahk
:
Tab::Suspend
RButton::LButton
which is a true rebind (in contrast to my program) that you can toggle on / off with Tab (or other button if needed) as well