I did this with CB only - if you're using the CB login module it doesn't need to touch Joomla ( I think - not heavily tested!
).
Diff of comprofiler.php:
[code:1]572c572
< $checkusername = trim( mosGetParam( $_POST, 'checkusername', '') );
---
> $checkusername = 1;
576c576
< . "\nWHERE username='$checkusername' AND email='$confirmEmail'"
---
> . "\nWHERE email='$confirmEmail'"
877c877
< . "\nWHERE u.username='".$username."' AND u.password='".$passwd."' AND u.id = ue.id"
---
> . "\nWHERE u.email='".$username."' AND u.password='".$passwd."' AND u.id = ue.id"
880a881
> $username = $row->username;
[/code:1]
Diff of comprofiler.html.php:
[code:1]783,786d782
< <td><?php echo _PROMPT_UNAME; ?></td>
< <td><input type="text" name="checkusername" class="inputbox" size="40" maxlength="25" /></td>
< </tr>
< <tr>
[/code:1]