Sorry for terrible writing, adjusted the comment to make sense grin

Grease because it comes from a Wizard will use Intelligence, Command because it comes from a Cleric will use Wisdom.

If for example you were to obtain Command from a Paladin, it would use Charisma. If you have Command from both a Cleric and a Paladin, then you could choose whether to use Wisdom (Cleric) or Charisma (Paladin) when casting it. It's based on the main attribute of the class the spell is obtained from.