You are able to fetch the id of the check box na.Now compare the all id's of book with the check box id and find the position.Now the discount will be percentage[position]
ex:
<input id="${book.Id}" type="checkbox" name="book" value="${book.Id}"/>
in javascript
<script>
var id = event.target.id;
var position;
var length = percentage.length();
for(var i=0;i<length;i++){
if( id == cardTypeId[i]){
position = i;
break;
}
}
var percen = percentage[position];
</script>