```php
If ( is_script_registered( 'jquery-cookie' ) )
{
  return; // nothing to do here
}
{
else if ( is_script_registered( 'foundation-cookie' ) )
{
  wp_register_script( 'query-cookie', array( 'foundation-cookie'  ) );
  return; //we registered a new handle as an alias of another
}
else ()
{
  wp_register_script( 'query-cookie', 'path-to-file' array( 'query'  ) );
  return; // register our own version of the plugin if no other version is already registered.
}