When the court must make a determination whether to order involuntary medications for the purpose of competency restoration or for maintenance of competency, the court shall inquire, and shall be told, and to the extent that the prosecutor or defense attorney is aware, whether the defendant is the subject of a pending civil commitment proceeding or has been ordered into involuntary treatment pursuant to a civil commitment proceeding.